Package org.exolab.adaptx.xml
Class IDIndexer
java.lang.Object
org.exolab.adaptx.xml.IDIndexer
A utility class which helps overcome some DOM 1.0 deficiencies.
- Version:
- $Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIdAttribute
(String attrName, String appliesTo) Adds the given attribute name as an ID attribute.void
addIdReference
(String id, XPathNode node) Associates the given Id with the given ElementgetElementById
(XPathNode root, String id) Determines the document order of a given node.
-
Constructor Details
-
IDIndexer
public IDIndexer()Creates a new DOMHelper
-
-
Method Details
-
addIdAttribute
Adds the given attribute name as an ID attribute.- Parameters:
attrName
- the name of the attribute to treat as an Id.appliesTo
- the element that this ID attribute appliesTo, "*" may be used to indicate all Elements.
-
addIdReference
Associates the given Id with the given Element- Parameters:
id
- the Id to associate with the given Elementelement
- the element which the Id maps to
-
getElementById
Determines the document order of a given node. Document Order is defined by the document order of the parent of the given node and the childNumber of the given Node. The document order for a Document node is 0.- Parameters:
root
- the "root" XPathNode to search withinid
- the Id of the element to return- Returns:
- the element XPathNode that is associated with the given Id, or null if no XPathNode was found
- See Also:
-