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

Schema com::thaiopensource::validate::nvdl::SchemaImpl::Handler::createSubSchema ( boolean  isAttributesSchema  )  throws IOException, IncorrectSchemaException, SAXException [inline, private]

Creates a sub schema for the ending validate action (this is called from finishValidate).

Parameters:
isAttributesSchema If the schema is intended to validate only attributes.
Returns:
A Schema.
Exceptions:
IOException 
IncorrectSchemaException 
SAXException 

Definition at line 753 of file SchemaImpl.java.

References com::thaiopensource::validate::nvdl::SchemaReceiverImpl::createChildSchema(), error(), com::thaiopensource::validate::Schema::getProperties(), com::thaiopensource::validate::nvdl::SchemaImpl::MustSupportOption::locator, md, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::mustSupportOptions, com::thaiopensource::validate::nvdl::SchemaImpl::MustSupportOption::name, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::options, com::thaiopensource::validate::nvdl::SchemaImpl::MustSupportOption::pid, resolver, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::schemaType, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::schemaUriBase, com::thaiopensource::validate::nvdl::SchemaImpl::Handler::ModeData::schemaUriRef, and sr.

Referenced by finishValidate().

                                                                                                                          {
      // the user specified options
      PropertyMap requestedProperties = md.options.toPropertyMap();
      // let the schema receiver create a child schema
      // XXX parse the media type to the resolver
      Schema schema = sr.createChildSchema(resolver.resolve(md.schemaUriRef, md.schemaUriBase),
                                           md.schemaType,
                                           requestedProperties,
                                           isAttributesSchema);
      // get the schema properties
      PropertyMap actualProperties = schema.getProperties();
      // Check if the actual properties match the must support properties.
      for (Enumeration e = md.mustSupportOptions.elements(); e.hasMoreElements();) {
        MustSupportOption mso = (MustSupportOption)e.nextElement();
        Object actualValue = actualProperties.get(mso.pid);
        if (actualValue == null)
          error("unsupported_option", mso.name, mso.locator);
        else if (!actualValue.equals(requestedProperties.get(mso.pid)))
          error("unsupported_option_arg", mso.name, mso.locator);
      }
      return schema;
    }


Generated by  Doxygen 1.6.0   Back to index