Package org.cyberneko.html.filters
Class Identity
java.lang.Object
org.cyberneko.html.filters.DefaultFilter
org.cyberneko.html.filters.Identity
- 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 performs the identity operation of the original
document event stream generated by the HTML scanner by removing
events that are synthesized by the tag balancer. This operation
is essentially the same as turning off tag-balancing in the
parser. However, this filter is useful when you want the tag
balancer to report "errors" but do not want the synthesized
events in the output.
Note: This filter requires the augmentations feature to be turned on. For example:
XMLParserConfiguration parser = new HTMLConfiguration();
parser.setFeature("http://cyberneko.org/html/features/augmentations", true);
Note: This isn't exactly the identify transform because the element and attributes names may have been modified from the original document. For example, by default, NekoHTML converts element names to upper-case and attribute names to lower-case.
- Version:
- $Id: Identity.java,v 1.4 2005/02/14 03:56:54 andyc Exp $
- Author:
- Andy Clark
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringAugmentations feature identifier.protected static final StringFilters property identifier.Fields inherited from class org.cyberneko.html.filters.DefaultFilter
fDocumentHandler, fDocumentSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidemptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) Empty element.voidendElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) End element.voidstartElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) Start element.protected static booleansynthesized(org.apache.xerces.xni.Augmentations augs) Returns true if the information provided is synthesized.Methods inherited from class org.cyberneko.html.filters.DefaultFilter
characters, comment, doctypeDecl, endCDATA, endDocument, endGeneralEntity, endPrefixMapping, getDocumentHandler, getDocumentSource, getFeatureDefault, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, ignorableWhitespace, merge, processingInstruction, reset, setDocumentHandler, setDocumentSource, setFeature, setProperty, startCDATA, startDocument, startDocument, startGeneralEntity, startPrefixMapping, textDecl, xmlDecl
-
Field Details
-
AUGMENTATIONS
Augmentations feature identifier.- See Also:
-
FILTERS
Filters property identifier.- See Also:
-
-
Constructor Details
-
Identity
public Identity()
-
-
Method Details
-
startElement
public void startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, 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 attributes, 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
-
synthesized
protected static boolean synthesized(org.apache.xerces.xni.Augmentations augs) Returns true if the information provided is synthesized.
-