|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.apache.xerces.dom.DOMNormalizer
This class adds implementation for normalizeDocument method. It acts as if the document was going through a save and load cycle, putting the document in a "normal" form. The actual result depends on the features being set and governing what operations actually take place. See setNormalizationFeature for details. Noticeably this method normalizes Text nodes, makes the document "namespace wellformed", according to the algorithm described below in pseudo code, by adding missing namespace declaration attributes and adding or changing namespace prefixes, updates the replacement tree of EntityReference nodes, normalizes attribute values, etc. Mutation events, when supported, are generated to reflect the changes occuring on the document. See Namespace normalization for details on how namespace declaration attributes and prefixes are normalized. NOTE: There is an initial support for DOM revalidation with XML Schema as a grammar. The tree might not be validated correctly if entityReferences, CDATA sections are present in the tree. The PSVI information is not exposed, normalized data (including element default content is not available). NOTE: the implementation is experimental and methods, functionality can be modified or removed in the future.
Inner Class Summary | |
protected class |
DOMNormalizer.XMLAttributesProxy
|
Field Summary | |
protected static boolean |
DEBUG
Debug namespace fix up algorithm |
protected static boolean |
DEBUG_ND
Debug normalize document |
protected static java.lang.String |
ERROR_HANDLER
Property identifier: error handler. |
protected java.util.Vector |
fAttributeList
list of attributes |
protected DOMNormalizer.XMLAttributesProxy |
fAttrProxy
|
protected CoreDocumentImpl |
fDocument
|
protected DOMErrorImpl |
fDOMError
DOM Error object |
protected org.apache.xerces.dom3.DOMErrorHandler |
fErrorHandler
error handler |
protected Grammar[] |
fGrammarPool
|
protected NamespaceSupport |
fLocalNSBinder
stores all namespace bindings on the current element |
protected DOMLocatorImpl |
fLocator
DOM Locator - for namespace fixup algorithm |
protected NamespaceSupport |
fNamespaceBinder
stores namespaces in scope |
protected int |
fNamespaceCounter
|
protected boolean |
fNamespaceValidation
|
protected QName |
fQName
|
protected SymbolTable |
fSymbolTable
symbol table |
protected RevalidationHandler |
fValidationHandler
Validation handler represents validator instance. |
protected static java.lang.String |
PREFIX
prefix added by namespace fixup algorithm should follow a pattern "NS" + index |
protected static java.lang.String |
SYMBOL_TABLE
Property identifier: symbol table. |
Constructor Summary | |
DOMNormalizer()
|
Method Summary | |
protected void |
addNamespaceDecl(java.lang.String prefix,
java.lang.String uri,
ElementImpl element)
Adds a namespace attribute or replaces the value of existing namespace attribute with the given prefix and value for URI. |
void |
cacheGrammars(java.lang.String grammarType,
Grammar[] grammars)
|
void |
clear()
|
protected void |
expandEntityRef(org.w3c.dom.Node node,
org.w3c.dom.Node parent,
org.w3c.dom.Node reference)
|
void |
lockPool()
|
protected org.apache.xerces.dom3.DOMError |
modifyDOMError(java.lang.String message,
short severity,
org.w3c.dom.Node node)
|
protected void |
namespaceFixUp(ElementImpl element,
AttributeMap attributes)
|
protected void |
normalizeDocument(CoreDocumentImpl document)
Normalizes document. |
protected org.w3c.dom.Node |
normalizeNode(org.w3c.dom.Node node)
This method acts as if the document was going through a save and load cycle, putting the document in a "normal" form. |
protected boolean |
removeDefault(org.w3c.dom.Attr attribute,
AttributeMap attrMap)
|
protected void |
reset(XMLComponentManager componentManager)
|
Grammar |
retrieveGrammar(XMLGrammarDescription desc)
|
Grammar[] |
retrieveInitialGrammarSet(java.lang.String grammarType)
|
protected void |
setValidationHandler(RevalidationHandler validator)
|
void |
unlockPool()
|
protected void |
updateQName(org.w3c.dom.Node node,
QName qname)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final boolean DEBUG_ND
protected static final boolean DEBUG
protected static final java.lang.String PREFIX
protected static final java.lang.String ERROR_HANDLER
protected static final java.lang.String SYMBOL_TABLE
protected CoreDocumentImpl fDocument
protected final DOMNormalizer.XMLAttributesProxy fAttrProxy
protected final QName fQName
protected RevalidationHandler fValidationHandler
protected SymbolTable fSymbolTable
protected org.apache.xerces.dom3.DOMErrorHandler fErrorHandler
protected int fNamespaceCounter
protected boolean fNamespaceValidation
protected final NamespaceSupport fNamespaceBinder
protected final NamespaceSupport fLocalNSBinder
protected final java.util.Vector fAttributeList
protected final DOMErrorImpl fDOMError
protected final DOMLocatorImpl fLocator
protected final Grammar[] fGrammarPool
Constructor Detail |
public DOMNormalizer()
Method Detail |
protected void reset(XMLComponentManager componentManager)
protected void setValidationHandler(RevalidationHandler validator)
protected void normalizeDocument(CoreDocumentImpl document)
protected org.w3c.dom.Node normalizeNode(org.w3c.dom.Node node)
node
- Modified node or null. If node is returned, we need
to normalize again starting on the node returned.protected final void expandEntityRef(org.w3c.dom.Node node, org.w3c.dom.Node parent, org.w3c.dom.Node reference)
protected final void namespaceFixUp(ElementImpl element, AttributeMap attributes)
protected final void addNamespaceDecl(java.lang.String prefix, java.lang.String uri, ElementImpl element)
prefix
- uri
- protected final boolean removeDefault(org.w3c.dom.Attr attribute, AttributeMap attrMap)
protected final org.apache.xerces.dom3.DOMError modifyDOMError(java.lang.String message, short severity, org.w3c.dom.Node node)
protected final void updateQName(org.w3c.dom.Node node, QName qname)
public Grammar[] retrieveInitialGrammarSet(java.lang.String grammarType)
public void cacheGrammars(java.lang.String grammarType, Grammar[] grammars)
public Grammar retrieveGrammar(XMLGrammarDescription desc)
public void lockPool()
public void unlockPool()
public void clear()
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs81b |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |