Class NamespaceBinder

  • All Implemented Interfaces:
    org.apache.xerces.xni.parser.XMLComponent, org.apache.xerces.xni.parser.XMLDocumentFilter, org.apache.xerces.xni.parser.XMLDocumentSource, org.apache.xerces.xni.XMLDocumentHandler, HTMLComponent

    public class NamespaceBinder
    extends DefaultFilter
    This filter binds namespaces if namespace processing is turned on by setting the feature "http://xml.org/sax/features/namespaces" is set to true.

    This configuration recognizes the following features:

    • http://xml.org/sax/features/namespaces
    Version:
    $Id: NamespaceBinder.java,v 1.8 2005/05/30 00:19:28 andyc Exp $
    Author:
    Andy Clark
    • Field Detail

      • XHTML_1_0_URI

        public static final java.lang.String XHTML_1_0_URI
        XHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).
        See Also:
        Constant Field Values
      • XML_URI

        public static final java.lang.String XML_URI
        XML namespace URI (http://www.w3.org/XML/1998/namespace).
        See Also:
        Constant Field Values
      • XMLNS_URI

        public static final java.lang.String XMLNS_URI
        XMLNS namespace URI (http://www.w3.org/2000/xmlns/).
        See Also:
        Constant Field Values
      • NAMESPACES

        protected static final java.lang.String NAMESPACES
        Namespaces.
        See Also:
        Constant Field Values
      • OVERRIDE_NAMESPACES

        protected static final java.lang.String OVERRIDE_NAMESPACES
        Override namespace binding URI.
        See Also:
        Constant Field Values
      • INSERT_NAMESPACES

        protected static final java.lang.String INSERT_NAMESPACES
        Insert namespace binding URIs.
        See Also:
        Constant Field Values
      • NAMES_ELEMS

        protected static final java.lang.String NAMES_ELEMS
        Modify HTML element names: { "upper", "lower", "default" }.
        See Also:
        Constant Field Values
      • NAMES_ATTRS

        protected static final java.lang.String NAMES_ATTRS
        Modify HTML attribute names: { "upper", "lower", "default" }.
        See Also:
        Constant Field Values
      • NAMESPACES_URI

        protected static final java.lang.String NAMESPACES_URI
        Namespaces URI.
        See Also:
        Constant Field Values
      • NAMES_NO_CHANGE

        protected static final short NAMES_NO_CHANGE
        Don't modify HTML names.
        See Also:
        Constant Field Values
      • NAMES_UPPERCASE

        protected static final short NAMES_UPPERCASE
        Uppercase HTML names.
        See Also:
        Constant Field Values
      • NAMES_LOWERCASE

        protected static final short NAMES_LOWERCASE
        Lowercase HTML names.
        See Also:
        Constant Field Values
      • fNamespaces

        protected boolean fNamespaces
        Namespaces.
      • fNamespacePrefixes

        protected boolean fNamespacePrefixes
        Namespace prefixes.
      • fOverrideNamespaces

        protected boolean fOverrideNamespaces
        Override namespaces.
      • fInsertNamespaces

        protected boolean fInsertNamespaces
        Insert namespaces.
      • fNamesElems

        protected short fNamesElems
        Modify HTML element names.
      • fNamesAttrs

        protected short fNamesAttrs
        Modify HTML attribute names.
      • fNamespacesURI

        protected java.lang.String fNamespacesURI
        Namespaces URI.
    • Constructor Detail

      • NamespaceBinder

        public NamespaceBinder()
    • Method Detail

      • getRecognizedFeatures

        public java.lang.String[] getRecognizedFeatures()
        Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.
        Specified by:
        getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponent
        Overrides:
        getRecognizedFeatures in class DefaultFilter
      • getFeatureDefault

        public java.lang.Boolean getFeatureDefault​(java.lang.String featureId)
        Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
        Specified by:
        getFeatureDefault in interface HTMLComponent
        Specified by:
        getFeatureDefault in interface org.apache.xerces.xni.parser.XMLComponent
        Overrides:
        getFeatureDefault in class DefaultFilter
      • getRecognizedProperties

        public java.lang.String[] getRecognizedProperties()
        Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.
        Specified by:
        getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponent
        Overrides:
        getRecognizedProperties in class DefaultFilter
      • getPropertyDefault

        public java.lang.Object getPropertyDefault​(java.lang.String propertyId)
        Returns the default value for a property, or null if this component does not want to report a default value for this property.
        Specified by:
        getPropertyDefault in interface HTMLComponent
        Specified by:
        getPropertyDefault in interface org.apache.xerces.xni.parser.XMLComponent
        Overrides:
        getPropertyDefault in class DefaultFilter
      • reset

        public void reset​(org.apache.xerces.xni.parser.XMLComponentManager manager)
                   throws org.apache.xerces.xni.parser.XMLConfigurationException
        Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
        Specified by:
        reset in interface org.apache.xerces.xni.parser.XMLComponent
        Overrides:
        reset in class DefaultFilter
        Parameters:
        manager - The component manager.
        Throws:
        org.apache.xerces.xni.XNIException - Thrown by component on initialization error.
        org.apache.xerces.xni.parser.XMLConfigurationException
      • startDocument

        public void startDocument​(org.apache.xerces.xni.XMLLocator locator,
                                  java.lang.String encoding,
                                  org.apache.xerces.xni.NamespaceContext nscontext,
                                  org.apache.xerces.xni.Augmentations augs)
                           throws org.apache.xerces.xni.XNIException
        Start document.
        Specified by:
        startDocument in interface org.apache.xerces.xni.XMLDocumentHandler
        Overrides:
        startDocument in class DefaultFilter
        Throws:
        org.apache.xerces.xni.XNIException
      • startElement

        public void startElement​(org.apache.xerces.xni.QName element,
                                 org.apache.xerces.xni.XMLAttributes attrs,
                                 org.apache.xerces.xni.Augmentations augs)
                          throws org.apache.xerces.xni.XNIException
        Start element.
        Specified by:
        startElement in interface org.apache.xerces.xni.XMLDocumentHandler
        Overrides:
        startElement in class DefaultFilter
        Throws:
        org.apache.xerces.xni.XNIException
      • emptyElement

        public void emptyElement​(org.apache.xerces.xni.QName element,
                                 org.apache.xerces.xni.XMLAttributes attrs,
                                 org.apache.xerces.xni.Augmentations augs)
                          throws org.apache.xerces.xni.XNIException
        Empty element.
        Specified by:
        emptyElement in interface org.apache.xerces.xni.XMLDocumentHandler
        Overrides:
        emptyElement in class DefaultFilter
        Throws:
        org.apache.xerces.xni.XNIException
      • endElement

        public void endElement​(org.apache.xerces.xni.QName element,
                               org.apache.xerces.xni.Augmentations augs)
                        throws org.apache.xerces.xni.XNIException
        End element.
        Specified by:
        endElement in interface org.apache.xerces.xni.XMLDocumentHandler
        Overrides:
        endElement in class DefaultFilter
        Throws:
        org.apache.xerces.xni.XNIException
      • splitQName

        protected static void splitQName​(org.apache.xerces.xni.QName qname)
        Splits a qualified name.
      • modifyName

        protected static final java.lang.String modifyName​(java.lang.String name,
                                                           short mode)
        Modifies the given name based on the specified mode.
      • bindNamespaces

        protected void bindNamespaces​(org.apache.xerces.xni.QName element,
                                      org.apache.xerces.xni.XMLAttributes attrs)
        Binds namespaces.