Class RELAXNGCompReader

  • 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 RELAXNGCompReader
    extends RELAXNGReader
    reads RELAX NG grammar with DTD compatibility annotation and constructs abstract grammar model.
    • Field Detail

      • defaultedAttributes

        private final java.util.Map defaultedAttributes
      • AnnotationNamespace

        public static final java.lang.String AnnotationNamespace
        Namespace URI of RELAX NG DTD compatibility annotation
        See Also:
        Constant Field Values
      • lastRNGElement

        private final LightStack lastRNGElement
        The local name of the preceding RELAX NG element sibling.
      • inAnnotation

        private boolean inAnnotation
      • CERR_ANN_CHILD_ELEMENT

        public static final java.lang.String CERR_ANN_CHILD_ELEMENT
        See Also:
        Constant Field Values
      • CERR_ANN_MISPLACED

        public static final java.lang.String CERR_ANN_MISPLACED
        See Also:
        Constant Field Values
      • CERR_ANN_INVALID_ATTRIBUTE

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

      • parse

        public static TREXGrammar parse​(java.lang.String grammarURL,
                                        GrammarReaderController controller)
        loads RELAX NG pattern.
        Returns:
        it always returns RELAXNGGrammar, but due to the restriction imposed by Java language, I cannot change the signature of this method.
      • parse

        public static TREXGrammar parse​(org.xml.sax.InputSource grammar,
                                        GrammarReaderController controller)
        loads RELAX NG pattern.
        Returns:
        it always returns RELAXNGGrammar, but due to the restriction imposed by Java language, I cannot change the signature of this method.
      • addDefaultValue

        protected final void addDefaultValue​(AttributeExp exp,
                                             java.lang.String value)
        note that the specified expression is marked with the default value. this method is called when a:defaultValue is found.
      • 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 RELAXNGReader
      • wrapUp

        public void wrapUp()
        Description copied from class: TREXBaseReader
        performs final wrap-up. This method is called from the RootState object, after the parsing is completed.

        This method has to be called after the run-away expression check is done.

        Overrides:
        wrapUp in class RELAXNGReader
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String local,
                                 java.lang.String qname,
                                 org.xml.sax.Attributes atts)
                          throws org.xml.sax.SAXException
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class RELAXNGReader
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String local,
                               java.lang.String qname)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class RELAXNGReader
        Throws:
        org.xml.sax.SAXException