Package org.cyberneko.html.filters
Class NamespaceBinder
java.lang.Object
org.cyberneko.html.filters.DefaultFilter
org.cyberneko.html.filters.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
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis namespace context object implements the old and new XNINamespaceContextinterface methods so that it can be used across all versions of Xerces2. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanInsert namespaces.protected shortModify HTML attribute names.protected shortModify HTML element names.protected final NamespaceBinder.NamespaceSupportNamespace context.protected booleanNamespace prefixes.protected booleanNamespaces.protected StringNamespaces URI.protected booleanOverride namespaces.protected static final StringInsert namespace binding URIs.protected static final StringModify HTML attribute names: { "upper", "lower", "default" }.protected static final StringModify HTML element names: { "upper", "lower", "default" }.protected static final shortLowercase HTML names.protected static final shortDon't modify HTML names.protected static final shortUppercase HTML names.protected static final StringNamespaces.protected static final StringNamespaces URI.protected static final StringOverride namespace binding URI.static final StringXHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).static final StringXML namespace URI (http://www.w3.org/XML/1998/namespace).static final StringXMLNS namespace URI (http://www.w3.org/2000/xmlns/).Fields inherited from class org.cyberneko.html.filters.DefaultFilter
fDocumentHandler, fDocumentSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbindNamespaces(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attrs) Binds namespaces.voidemptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attrs, org.apache.xerces.xni.Augmentations augs) Empty element.voidendElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) End element.getFeatureDefault(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.protected static final shortgetNamesValue(String value) Converts HTML names string value to constant value.getPropertyDefault(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.String[]Returns a list of feature identifiers that are recognized by this component.String[]Returns a list of property identifiers that are recognized by this component.protected static final StringmodifyName(String name, short mode) Modifies the given name based on the specified mode.voidreset(org.apache.xerces.xni.parser.XMLComponentManager manager) Resets the component.protected static voidsplitQName(org.apache.xerces.xni.QName qname) Splits a qualified name.voidstartDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs) Start document.voidstartElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attrs, org.apache.xerces.xni.Augmentations augs) Start element.Methods inherited from class org.cyberneko.html.filters.DefaultFilter
characters, comment, doctypeDecl, endCDATA, endDocument, endGeneralEntity, endPrefixMapping, getDocumentHandler, getDocumentSource, ignorableWhitespace, merge, processingInstruction, setDocumentHandler, setDocumentSource, setFeature, setProperty, startCDATA, startDocument, startGeneralEntity, startPrefixMapping, textDecl, xmlDecl
-
Field Details
-
XHTML_1_0_URI
XHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).- See Also:
-
XML_URI
XML namespace URI (http://www.w3.org/XML/1998/namespace).- See Also:
-
XMLNS_URI
XMLNS namespace URI (http://www.w3.org/2000/xmlns/).- See Also:
-
NAMESPACES
Namespaces.- See Also:
-
OVERRIDE_NAMESPACES
Override namespace binding URI.- See Also:
-
INSERT_NAMESPACES
Insert namespace binding URIs.- See Also:
-
NAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }.- See Also:
-
NAMES_ATTRS
Modify HTML attribute names: { "upper", "lower", "default" }.- See Also:
-
NAMESPACES_URI
Namespaces URI.- See Also:
-
NAMES_NO_CHANGE
protected static final short NAMES_NO_CHANGEDon't modify HTML names.- See Also:
-
NAMES_UPPERCASE
protected static final short NAMES_UPPERCASEUppercase HTML names.- See Also:
-
NAMES_LOWERCASE
protected static final short NAMES_LOWERCASELowercase HTML names.- See Also:
-
fNamespaces
protected boolean fNamespacesNamespaces. -
fNamespacePrefixes
protected boolean fNamespacePrefixesNamespace prefixes. -
fOverrideNamespaces
protected boolean fOverrideNamespacesOverride namespaces. -
fInsertNamespaces
protected boolean fInsertNamespacesInsert namespaces. -
fNamesElems
protected short fNamesElemsModify HTML element names. -
fNamesAttrs
protected short fNamesAttrsModify HTML attribute names. -
fNamespacesURI
Namespaces URI. -
fNamespaceContext
Namespace context.
-
-
Constructor Details
-
NamespaceBinder
public NamespaceBinder()
-
-
Method Details
-
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:
getRecognizedFeaturesin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getRecognizedFeaturesin classDefaultFilter
-
getFeatureDefault
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:
getFeatureDefaultin interfaceHTMLComponent- Specified by:
getFeatureDefaultin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getFeatureDefaultin classDefaultFilter
-
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:
getRecognizedPropertiesin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getRecognizedPropertiesin classDefaultFilter
-
getPropertyDefault
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:
getPropertyDefaultin interfaceHTMLComponent- Specified by:
getPropertyDefaultin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getPropertyDefaultin classDefaultFilter
-
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:
resetin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
resetin classDefaultFilter- 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, String encoding, org.apache.xerces.xni.NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start document.- Specified by:
startDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startDocumentin classDefaultFilter- 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:
startElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startElementin classDefaultFilter- 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:
emptyElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
emptyElementin classDefaultFilter- 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:
endElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
endElementin classDefaultFilter- Throws:
org.apache.xerces.xni.XNIException
-
splitQName
protected static void splitQName(org.apache.xerces.xni.QName qname) Splits a qualified name. -
getNamesValue
Converts HTML names string value to constant value.- See Also:
-
modifyName
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.
-