Confirmed users
146
edits
m (→Proposed IDL) |
|||
Line 110: | Line 110: | ||
DOMString generateXPath(in nsIDOMNode targetNode | DOMString generateXPath(in nsIDOMNode targetNode | ||
in nsIDOMNode contextNode); | in nsIDOMNode contextNode); | ||
/** | |||
* Generate a xpointer as a string. | |||
* | |||
* @param targetNode The node our xpath ends at. | |||
* @param contextNode The node our xpath starts from. If null, use targetNode's owner document. | |||
* | |||
* @return DOMString XPointer from the context node to the target node. | |||
*/ | |||
DOMString generateXPointer(in nsIDOMNode targetNode | |||
in nsIDOMNode contextNode); | |||
} | } | ||
</pre> | </pre> | ||
== API Notes == | |||
The resolver of each XPathGenerator object would not be a standard document.createNSResolver(node) object. Instead, the XPathGenerator object will create and maintain the resolver independently. This will allow the generator to add additional namespaces transparently and harmlessly as needed. | The resolver of each XPathGenerator object would not be a standard document.createNSResolver(node) object. Instead, the XPathGenerator object will create and maintain the resolver independently. This will allow the generator to add additional namespaces transparently and harmlessly as needed. | ||