Changes

Jump to: navigation, search

DOM/XPath Generator

309 bytes added, 06:44, 3 February 2006
m
Proposed IDL
<pre>
 
#include "domstubs.idl"
#include "nsIDOMXPathNSResolver.idl"
[scriptable, uuid(ab50beb3341d8cbe-4049bcb3-42994d9a-92eaa5a6-4dea4609a1e1dd4ef72a402d)]
interface nsIXPathGenerator : nsISupports {
/* A collection of bitwise flags which modify behavior.
// Ignore ID-type attribute nodes on elements and continue to the document node.
const unsigned long GO_TO_DOCUMENT_ROOT = 0x00000001;
 
// Return expression containing a single step that uses the descendant axis.
const unsigned long USE_DESCENDANT_AXIS = 0x00000002;
/**
* Flags which modify the parameters used to generate the xpath string.
*/
attribute unsigned long attribute searchFlags;
/**
* Namespace resolver corresponding to all generated xpaths.
*/
readonly attribute nsIDOMXPathNSResolver resolver;  /** * Add a namespace URI and prefix to the namespace resolver. */ void addNamespace(in DOMString namespaceURI, in DOMString prefix);
/**
* Generate the a xpath 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 XPath from the context node to the target node.
*/
DOMString generateXPath(in nsIDOMNode targetNode,
in nsIDOMNode contextNode);
*
* @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>
Confirm
146
edits

Navigation menu