Logo Search packages:      
Sourcecode: jing-trang version File versions  Download package

void com::thaiopensource::validate::nvdl::SchemaImpl::Handler::parseContext ( Attributes  attributes  )  throws SAXException [inline, private]

Parse context dependent mode usages.

Parameters:
attributes The context element attributes.
Exceptions:
SAXException 

Definition at line 967 of file SchemaImpl.java.

References com::thaiopensource::validate::nvdl::ModeUsage::addContext(), error(), com::thaiopensource::validate::nvdl::Path::getNames(), getUseMode(), com::thaiopensource::validate::nvdl::Path::isRoot(), com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::lastMode, md, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::modeUsage, and com::thaiopensource::validate::nvdl::Path::toString().

Referenced by startElement().

                                                                         {
      // TODO: check this in the NVDL spec.
      // context not allowed within anyNamespace.???
      // IT SEEMS IT IS ALLOWED IN NVDL...
      //if (md.anyNamespace) {
      //  error("context_any_namespace");
      //  return;
      //}
      // Get the mode to be used further on this context.
      Mode mode = getUseMode(attributes);
      md.lastMode = mode;
      try {
        // parse the path value into a list of Path objects
        // and add them to the mode usage
        Vector paths = Path.parse(attributes.getValue("", "path"));
        // XXX warning if modeUsage is null
        if (md.modeUsage != null) {
          for (int i = 0, len = paths.size(); i < len; i++) {
            Path path = (Path)paths.elementAt(i);
            if (!md.modeUsage.addContext(path.isRoot(), path.getNames(), mode))
              error("duplicate_path", path.toString());
          }
        }
      }
      catch (Path.ParseException e) {
        error(e.getMessageKey());
      }
    }


Generated by  Doxygen 1.6.0   Back to index