<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peterv</id>
	<title>WHATWG Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peterv"/>
	<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/wiki/Special:Contributions/Peterv"/>
	<updated>2026-06-03T10:12:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DOM_XPath&amp;diff=9740</id>
		<title>DOM XPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DOM_XPath&amp;diff=9740"/>
		<updated>2014-10-22T18:09:00Z</updated>

		<summary type="html">&lt;p&gt;Peterv: Add some more interfaces and correct existing ones&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If someone ever decides to write down DOM XPath (i.e. a proper version of the [http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html DOM3XPath note]), take this into account:&lt;br /&gt;
&lt;br /&gt;
* Integrate the XPath part of the section [http://www.whatwg.org/C#interactions-with-xpath-and-xslt Interactions with XPath and XSLT] from HTML.&lt;br /&gt;
* Make it clear that contrary to XPath 1.0 multiple Text nodes can indeed be returned, even if they are siblings. The DOM is not the XML InfoSet. (As is the case in WebKit and Gecko today.)&lt;br /&gt;
* Simplifications: http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0310.html&lt;br /&gt;
* Exceptions: https://bugzilla.mozilla.org/show_bug.cgi?id=743888&lt;br /&gt;
&lt;br /&gt;
== WebIDL interfaces ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface XPathResult {&lt;br /&gt;
  const unsigned short      ANY_TYPE                       = 0;&lt;br /&gt;
  const unsigned short      NUMBER_TYPE                    = 1;&lt;br /&gt;
  const unsigned short      STRING_TYPE                    = 2;&lt;br /&gt;
  const unsigned short      BOOLEAN_TYPE                   = 3;&lt;br /&gt;
  const unsigned short      UNORDERED_NODE_ITERATOR_TYPE   = 4;&lt;br /&gt;
  const unsigned short      ORDERED_NODE_ITERATOR_TYPE     = 5;&lt;br /&gt;
  const unsigned short      UNORDERED_NODE_SNAPSHOT_TYPE   = 6;&lt;br /&gt;
  const unsigned short      ORDERED_NODE_SNAPSHOT_TYPE     = 7;&lt;br /&gt;
  const unsigned short      ANY_UNORDERED_NODE_TYPE        = 8;&lt;br /&gt;
  const unsigned short      FIRST_ORDERED_NODE_TYPE        = 9;&lt;br /&gt;
&lt;br /&gt;
  readonly attribute unsigned short resultType;&lt;br /&gt;
  readonly attribute unrestricted double numberValue;&lt;br /&gt;
  // Maybe &amp;quot;DOMString?&amp;quot;.&lt;br /&gt;
  readonly attribute DOMString stringValue;&lt;br /&gt;
  readonly attribute boolean booleanValue;&lt;br /&gt;
  readonly attribute Node singleNodeValue;&lt;br /&gt;
  readonly attribute boolean          invalidIteratorState;&lt;br /&gt;
  readonly attribute unsigned long    snapshotLength;&lt;br /&gt;
  Node?               iterateNext();&lt;br /&gt;
  Node?               snapshotItem(unsigned long index);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
interface XPathExpression {&lt;br /&gt;
  XPathResult evaluate(Node contextNode,&lt;br /&gt;
                       unsigned short type,&lt;br /&gt;
                       object? result);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
callback interface XPathNSResolver&lt;br /&gt;
{&lt;br /&gt;
  DOMString? lookupNamespaceURI(DOMString? prefix);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
[Constructor]&lt;br /&gt;
interface XPathEvaluator {&lt;br /&gt;
  XPathExpression    createExpression(DOMString expression, &lt;br /&gt;
                                      XPathNSResolver? resolver);&lt;br /&gt;
  XPathNSResolver    createNSResolver(Node nodeResolver);&lt;br /&gt;
  XPathResult        evaluate(DOMString expression, &lt;br /&gt;
                              Node contextNode, &lt;br /&gt;
                              XPathNSResolver? resolver, &lt;br /&gt;
                              unsigned short type, &lt;br /&gt;
                              object? result);&lt;br /&gt;
};&lt;br /&gt;
Document implements XPathEvaluator;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, you can both construct this object and access its methods on Document. Isn&#039;t the world wonderful?&lt;br /&gt;
&lt;br /&gt;
[[Category:Spec coordination]]&lt;/div&gt;</summary>
		<author><name>Peterv</name></author>
	</entry>
</feed>