public class HTMLTagBalancer extends Object implements org.apache.xerces.xni.parser.XMLDocumentFilter, HTMLComponent
This component recognizes the following features:
This component recognizes the following properties:
HTMLElements| Modifier and Type | Class and Description |
|---|---|
static class |
HTMLTagBalancer.Info
Element info for each start element.
|
static class |
HTMLTagBalancer.InfoStack
Unsynchronized stack of element information.
|
| Modifier and Type | Field and Description |
|---|---|
protected static String |
AUGMENTATIONS
Include infoset augmentations.
|
protected static String |
DOCUMENT_FRAGMENT
Document fragment balancing only.
|
protected static String |
DOCUMENT_FRAGMENT_DEPRECATED
Document fragment balancing only (deprecated).
|
protected static String |
ERROR_REPORTER
Error reporter.
|
protected boolean |
fAllowSelfclosingIframe
Allows self closing iframe tags.
|
protected boolean |
fAllowSelfclosingTags
Allows self closing tags.
|
protected boolean |
fAugmentations
Include infoset augmentations.
|
protected boolean |
fDocumentFragment
Document fragment balancing only.
|
protected org.apache.xerces.xni.XMLDocumentHandler |
fDocumentHandler
The document handler.
|
protected org.apache.xerces.xni.parser.XMLDocumentSource |
fDocumentSource
The document source.
|
protected HTMLTagBalancer.InfoStack |
fElementStack
The element stack.
|
protected HTMLErrorReporter |
fErrorReporter
Error reporter.
|
protected boolean |
fIgnoreOutsideContent
Ignore outside content.
|
protected HTMLTagBalancer.InfoStack |
fInlineStack
The inline stack.
|
protected short |
fNamesAttrs
Modify HTML attribute names.
|
protected short |
fNamesElems
Modify HTML element names.
|
protected boolean |
fNamespaces
Namespaces.
|
protected boolean |
fOpenedForm
True if a form is in the stack (allow to discard opening of nested forms)
|
protected boolean |
fOpenedSvg
True if a svg is in the stack (no parent checking takes place)
|
static String |
FRAGMENT_CONTEXT_STACK
<font color="red">EXPERIMENTAL: may change in next release</font><br/>
Name of the property holding the stack of elements in which context a document fragment should be parsed.
|
protected boolean |
fReportErrors
Report errors.
|
protected boolean |
fSeenAnything
True if seen anything.
|
protected boolean |
fSeenBodyElement
True if seen
body element. |
protected boolean |
fSeenDoctype
True if root element has been seen.
|
protected boolean |
fSeenHeadElement
True if seen
head element. |
protected boolean |
fSeenRootElement
True if root element has been seen.
|
protected boolean |
fSeenRootElementEnd
True if seen the end of the document element.
|
protected boolean |
fTemplateFragment
Template document fragment balancing only.
|
protected static String |
IGNORE_OUTSIDE_CONTENT
Ignore outside content.
|
protected static String |
NAMES_ATTRS
Modify HTML attribute names: { "upper", "lower", "default" }.
|
protected static String |
NAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }.
|
protected static short |
NAMES_LOWERCASE
Lowercase HTML names.
|
protected static short |
NAMES_MATCH
Match HTML element names.
|
protected static short |
NAMES_NO_CHANGE
Don't modify HTML names.
|
protected static short |
NAMES_UPPERCASE
Uppercase HTML names.
|
protected static String |
NAMESPACES
Namespaces.
|
protected static String |
REPORT_ERRORS
Report errors.
|
protected static HTMLEventInfo |
SYNTHESIZED_ITEM
Synthesized event info item.
|
protected HTMLTagBalancingListener |
tagBalancingListener |
| Modifier and Type | Method and Description |
|---|---|
protected void |
callEndElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs) |
protected void |
callStartElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs) |
void |
characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
Characters.
|
void |
comment(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
Comment.
|
void |
doctypeDecl(String rootElementName,
String publicId,
String systemId,
org.apache.xerces.xni.Augmentations augs)
Doctype declaration.
|
protected org.apache.xerces.xni.XMLAttributes |
emptyAttributes() |
void |
emptyElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs)
Empty element.
|
void |
endCDATA(org.apache.xerces.xni.Augmentations augs)
End CDATA section.
|
void |
endDocument(org.apache.xerces.xni.Augmentations augs)
End document.
|
void |
endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
End element.
|
void |
endGeneralEntity(String name,
org.apache.xerces.xni.Augmentations augs)
End entity.
|
org.apache.xerces.xni.XMLDocumentHandler |
getDocumentHandler()
Returns the document handler.
|
org.apache.xerces.xni.parser.XMLDocumentSource |
getDocumentSource()
Returns the document source.
|
protected HTMLElements.Element |
getElement(org.apache.xerces.xni.QName elementName) |
protected int |
getElementDepth(HTMLElements.Element element) |
Boolean |
getFeatureDefault(String featureId)
Returns the default state for a feature.
|
protected static short |
getNamesValue(String value) |
protected int |
getParentDepth(HTMLElements.Element[] parents,
short bounds) |
Object |
getPropertyDefault(String propertyId)
Returns the default state for a property.
|
String[] |
getRecognizedFeatures()
Returns recognized features.
|
String[] |
getRecognizedProperties()
Returns recognized properties.
|
void |
ignorableWhitespace(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
Ignorable whitespace.
|
protected static String |
modifyName(String name,
short mode) |
void |
processingInstruction(String target,
org.apache.xerces.xni.XMLString data,
org.apache.xerces.xni.Augmentations augs)
Processing instruction.
|
void |
reset(org.apache.xerces.xni.parser.XMLComponentManager manager)
Resets the component.
|
void |
setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
Sets the document handler.
|
void |
setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)
Sets the document source.
|
void |
setFeature(String featureId,
boolean state)
Sets a feature.
|
void |
setProperty(String propertyId,
Object value)
Sets a property.
|
void |
startCDATA(org.apache.xerces.xni.Augmentations augs)
Start CDATA section.
|
void |
startDocument(org.apache.xerces.xni.XMLLocator locator,
String encoding,
org.apache.xerces.xni.NamespaceContext nscontext,
org.apache.xerces.xni.Augmentations augs)
Start document.
|
void |
startElement(org.apache.xerces.xni.QName elem,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs)
Start element.
|
void |
startGeneralEntity(String name,
org.apache.xerces.xni.XMLResourceIdentifier id,
String encoding,
org.apache.xerces.xni.Augmentations augs)
Start entity.
|
protected org.apache.xerces.xni.Augmentations |
synthesizedAugs() |
void |
textDecl(String version,
String encoding,
org.apache.xerces.xni.Augmentations augs)
Text declaration.
|
void |
xmlDecl(String version,
String encoding,
String standalone,
org.apache.xerces.xni.Augmentations augs)
XML declaration.
|
protected static final String NAMESPACES
protected static final String AUGMENTATIONS
protected static final String REPORT_ERRORS
protected static final String DOCUMENT_FRAGMENT_DEPRECATED
protected static final String DOCUMENT_FRAGMENT
protected static final String IGNORE_OUTSIDE_CONTENT
protected static final String NAMES_ELEMS
protected static final String NAMES_ATTRS
protected static final String ERROR_REPORTER
public static final String FRAGMENT_CONTEXT_STACK
protected static final short NAMES_NO_CHANGE
protected static final short NAMES_MATCH
protected static final short NAMES_UPPERCASE
protected static final short NAMES_LOWERCASE
protected static final HTMLEventInfo SYNTHESIZED_ITEM
protected boolean fNamespaces
protected boolean fAugmentations
protected boolean fReportErrors
protected boolean fDocumentFragment
protected boolean fTemplateFragment
protected boolean fIgnoreOutsideContent
protected boolean fAllowSelfclosingIframe
protected boolean fAllowSelfclosingTags
protected short fNamesElems
protected short fNamesAttrs
protected HTMLErrorReporter fErrorReporter
protected org.apache.xerces.xni.parser.XMLDocumentSource fDocumentSource
protected org.apache.xerces.xni.XMLDocumentHandler fDocumentHandler
protected final HTMLTagBalancer.InfoStack fElementStack
protected final HTMLTagBalancer.InfoStack fInlineStack
protected boolean fSeenAnything
protected boolean fSeenDoctype
protected boolean fSeenRootElement
protected boolean fSeenRootElementEnd
protected boolean fSeenHeadElement
head element.protected boolean fSeenBodyElement
body element.protected boolean fOpenedForm
protected boolean fOpenedSvg
protected HTMLTagBalancingListener tagBalancingListener
public Boolean getFeatureDefault(String featureId)
getFeatureDefault in interface HTMLComponentgetFeatureDefault in interface org.apache.xerces.xni.parser.XMLComponentpublic Object getPropertyDefault(String propertyId)
getPropertyDefault in interface HTMLComponentgetPropertyDefault in interface org.apache.xerces.xni.parser.XMLComponentpublic String[] getRecognizedFeatures()
getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponentpublic String[] getRecognizedProperties()
getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponentpublic void reset(org.apache.xerces.xni.parser.XMLComponentManager manager)
throws org.apache.xerces.xni.parser.XMLConfigurationException
reset in interface org.apache.xerces.xni.parser.XMLComponentorg.apache.xerces.xni.parser.XMLConfigurationExceptionpublic void setFeature(String featureId, boolean state) throws org.apache.xerces.xni.parser.XMLConfigurationException
setFeature in interface org.apache.xerces.xni.parser.XMLComponentorg.apache.xerces.xni.parser.XMLConfigurationExceptionpublic void setProperty(String propertyId, Object value) throws org.apache.xerces.xni.parser.XMLConfigurationException
setProperty in interface org.apache.xerces.xni.parser.XMLComponentorg.apache.xerces.xni.parser.XMLConfigurationExceptionpublic void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
setDocumentHandler in interface org.apache.xerces.xni.parser.XMLDocumentSourcepublic org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()
getDocumentHandler in interface org.apache.xerces.xni.parser.XMLDocumentSourcepublic 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
startDocument in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void xmlDecl(String version, String encoding, String standalone, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
xmlDecl in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void doctypeDecl(String rootElementName, String publicId, String systemId, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
doctypeDecl in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endDocument(org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endDocument in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void comment(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
comment in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void processingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
processingInstruction in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startElement(org.apache.xerces.xni.QName elem,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
startElement in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic 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
emptyElement in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startGeneralEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier id, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
startGeneralEntity in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void textDecl(String version, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
textDecl in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endGeneralEntity(String name, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
endGeneralEntity in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startCDATA(org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
startCDATA in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endCDATA(org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endCDATA in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
characters in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void ignorableWhitespace(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
ignorableWhitespace in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endElement in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)
setDocumentSource in interface org.apache.xerces.xni.XMLDocumentHandlerpublic org.apache.xerces.xni.parser.XMLDocumentSource getDocumentSource()
getDocumentSource in interface org.apache.xerces.xni.XMLDocumentHandlerprotected HTMLElements.Element getElement(org.apache.xerces.xni.QName elementName)
protected final void callStartElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionprotected final void callEndElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionprotected final int getElementDepth(HTMLElements.Element element)
element - The element.protected int getParentDepth(HTMLElements.Element[] parents, short bounds)
parents - The parent elements.bounds - boundsprotected final org.apache.xerces.xni.XMLAttributes emptyAttributes()
protected final org.apache.xerces.xni.Augmentations synthesizedAugs()
protected static final short getNamesValue(String value)
Copyright © 2021 Gargoyle Software Inc.. All rights reserved.