|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--mozile.Module | +--mozile.xpath
Method Summary | |
<static> Array
|
evaluate(<String> expression, root)
Evaluates an XPath expression in the context of the document or a node. |
<static> Object
|
getComponent(<String> expression)
Takes a simple XPath expression and returns an object with "name", "localName", and "position" properties for the last node in the path. |
<static> Array
|
getComponents(<String> expression)
Takes an XPath expression, splits it at "/" characters, and returns a cleaned array. |
<static> Node
|
getNode(<String> expression, <Node> root)
A basic XPath processor. |
<static> String
|
getXPath(<Node> node, <Node> root)
Returns a simple unique XPath location for the given node. |
Method Detail |
<static> Array evaluate(<String> expression, root)
This method only supports Mozilla browsers and IE versions with MSXML 3.0+. For name space resolution, see http://www.faqts.com/knowledge_base/view.phtml/aid/34022/fid/119 TODO: The namespace resolver should be more clever.
expression
- The XPath expression.
node
- Optional. The context within which the expression should be executed. The default is the documentElement.
<static> Object getComponent(<String> expression)
expression
- The XPath expression to be used.
<static> Array getComponents(<String> expression)
expression
- The XPath expression to be split.
<static> Node getNode(<String> expression, <Node> root)
For simple paths, this should work in any browser. Under Mozilla and IE evaluateXPath is used.
expression
- An XPath expression.
root
- An XML node or document. The path is evaluated relative to this node.
<static> String getXPath(<Node> node, <Node> root)
node
- The target node.
root
- The root of the XPath expression. Defaults to the document.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |