org.cyberneko.html.filters

Class Identity

public class Identity extends DefaultFilter

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
protected static StringAUGMENTATIONS
Augmentations feature identifier.
protected static StringFILTERS
Filters property identifier.
Method Summary
voidemptyElement(QName element, XMLAttributes attributes, Augmentations augs)
Empty element.
voidendElement(QName element, Augmentations augs)
End element.
voidstartElement(QName element, XMLAttributes attributes, Augmentations augs)
Start element.
protected static booleansynthesized(Augmentations augs)
Returns true if the information provided is synthesized.

Field Detail

AUGMENTATIONS

protected static final String AUGMENTATIONS
Augmentations feature identifier.

FILTERS

protected static final String FILTERS
Filters property identifier.

Method Detail

emptyElement

public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
Empty element.

endElement

public void endElement(QName element, Augmentations augs)
End element.

startElement

public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
Start element.

synthesized

protected static boolean synthesized(Augmentations augs)
Returns true if the information provided is synthesized.
(C) Copyright 2002-2005, Andy Clark. All rights reserved.