diff --git a/reference/dom/domnode/getnodepath.xml b/reference/dom/domnode/getnodepath.xml new file mode 100644 index 0000000000..6d07497008 --- /dev/null +++ b/reference/dom/domnode/getnodepath.xml @@ -0,0 +1,109 @@ + + + + + + DOMNode::getNodePath + Get an XPath for a node + + + + &reftitle.description; + + public stringDOMNode::getNodePath + + + + Gets an XPath location path for the node. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a string containing the XPath, or &null; in case of an error. + + + + + &reftitle.examples; + + + <methodname>DOMNode::getNodePath</methodname> example + +loadXML(' + + + braeburn + granny smith + + + conference + + +'); + +// Print XPath for each element +foreach ($dom->getElementsByTagName('*') as $node) { + echo $node->getNodePath() . "\n"; +} +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + DOMXPath + + + + + + +