Class RELAXNSReader

  • All Implemented Interfaces:
    IDContextProvider2, org.relaxng.datatype.ValidationContext, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

    public class RELAXNSReader
    extends RELAXReader
    parses RELAX Namespace XML and constructs a SchemaProvider.
    • Field Detail

      • RELAXNamespaceNamespace

        public static final java.lang.String RELAXNamespaceNamespace
        namespace URI of RELAX Namespace.
        See Also:
        Constant Field Values
      • grammar

        public final RELAXGrammar grammar
        RELAX grammar that is currentlt being loaded
      • schemaProvider

        protected org.iso_relax.dispatcher.SchemaProvider schemaProvider
      • WRN_ILLEGAL_RELAXNAMESPACE_VERSION

        public static final java.lang.String WRN_ILLEGAL_RELAXNAMESPACE_VERSION
        See Also:
        Constant Field Values
      • ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE

        public static final java.lang.String ERR_TOPLEVEL_PARTICLE_MUST_BE_RELAX_CORE
        See Also:
        Constant Field Values
      • ERR_INLINEMODULE_NOT_FOUND

        public static final java.lang.String ERR_INLINEMODULE_NOT_FOUND
        See Also:
        Constant Field Values
      • ERR_UNKNOWN_LANGUAGE

        public static final java.lang.String ERR_UNKNOWN_LANGUAGE
        See Also:
        Constant Field Values
      • ERR_NAMESPACE_COLLISION

        public static final java.lang.String ERR_NAMESPACE_COLLISION
        See Also:
        Constant Field Values
    • Method Detail

      • getResult

        public final RELAXGrammar getResult()
        obtains parsed grammar object only if parsing was successful.
      • getResultAsGrammar

        public Grammar getResultAsGrammar()
        Description copied from class: GrammarReader
        gets the parsed AGM. Should any error happens, this method should returns null. derived classes should implement type-safe getGrammar method, along with this method.
        Specified by:
        getResultAsGrammar in class GrammarReader
      • getSchemaProvider

        public final org.iso_relax.dispatcher.SchemaProvider getSchemaProvider()
        obtains parsed grammar object as SchemaProvider only if parsing was successful.
      • getIslandSchemaReader

        public org.iso_relax.dispatcher.IslandSchemaReader getIslandSchemaReader​(java.lang.String language,
                                                                                 java.lang.String expectedTargetNamespace)
        creates an IslandSchemaReader that can parse the specified language. This method can be overrided by the derived class to incorporate other language implementations.
        Returns:
        return null if the given language is unrecognized. error will be handled by the caller. So this method should not attempt to report nor recover from error.
      • resolveDataType

        public org.relaxng.datatype.Datatype resolveDataType​(java.lang.String typeName)
      • resolveElementRef

        protected Expression resolveElementRef​(java.lang.String namespace,
                                               java.lang.String label)
        Description copied from class: RELAXReader
        obtains an Expression specified by given (namespace,label) pair. this method is called to parse <ref label="..." /> element.
        Specified by:
        resolveElementRef in class RELAXReader
      • resolveHedgeRef

        protected Expression resolveHedgeRef​(java.lang.String namespace,
                                             java.lang.String label)
        Description copied from class: RELAXReader
        obtains an Expression specified by given (namespace,label) pair. this method is called to parse <hedgeRef label="..." /> element.
        Specified by:
        resolveHedgeRef in class RELAXReader
      • resolveRef

        private Expression resolveRef​(java.lang.String namespace,
                                      java.lang.String label,
                                      java.lang.String tagName)
      • localizeMessage

        protected java.lang.String localizeMessage​(java.lang.String propertyName,
                                                   java.lang.Object[] args)
        Description copied from class: GrammarReader
        formats localized message with arguments
        Overrides:
        localizeMessage in class RELAXReader