@@ -9855,6 +9855,88 @@ the given value.
9855
9855
9856
9856
9857
9857
9858
+ <h2 id=xpath>XPath</h2>
9859
+
9860
+ <p class=XXX><cite> DOM Level 3 XPath</cite> defined an API for evaluating <cite> XPath 1.0</cite>
9861
+ expressions. These APIs are widely implemented, but have not been maintained. The interface
9862
+ definitions are maintained here so that they can be updated when <cite> Web IDL</cite> changes.
9863
+ Complete definitions of these APIs remain necessary and such work is tracked and can be contributed
9864
+ to in <a href="https://github.com/whatwg/dom/issues/67">whatwg/dom#67</a> . [[DOM-Level-3-XPath]]
9865
+ [[XPath]] [[WEBIDL]]
9866
+
9867
+
9868
+ <h3 id=interface-xpathresult>Interface {{XPathResult}}</h3>
9869
+
9870
+ <pre class=idl>
9871
+ [Exposed=Window]
9872
+ interface XPathResult {
9873
+ const unsigned short ANY_TYPE = 0;
9874
+ const unsigned short NUMBER_TYPE = 1;
9875
+ const unsigned short STRING_TYPE = 2;
9876
+ const unsigned short BOOLEAN_TYPE = 3;
9877
+ const unsigned short UNORDERED_NODE_ITERATOR_TYPE = 4;
9878
+ const unsigned short ORDERED_NODE_ITERATOR_TYPE = 5;
9879
+ const unsigned short UNORDERED_NODE_SNAPSHOT_TYPE = 6;
9880
+ const unsigned short ORDERED_NODE_SNAPSHOT_TYPE = 7;
9881
+ const unsigned short ANY_UNORDERED_NODE_TYPE = 8;
9882
+ const unsigned short FIRST_ORDERED_NODE_TYPE = 9;
9883
+
9884
+ readonly attribute unsigned short resultType;
9885
+ readonly attribute unrestricted double numberValue;
9886
+ readonly attribute DOMString stringValue;
9887
+ readonly attribute boolean booleanValue;
9888
+ readonly attribute Node? singleNodeValue;
9889
+ readonly attribute boolean invalidIteratorState;
9890
+ readonly attribute unsigned long snapshotLength;
9891
+
9892
+ Node? iterateNext();
9893
+ Node? snapshotItem(unsigned long index);
9894
+ };
9895
+ </pre>
9896
+
9897
+
9898
+ <h3 id=interface-xpathexpression>Interface {{XPathExpression}}</h3>
9899
+
9900
+ <pre class=idl>
9901
+ [Exposed=Window]
9902
+ interface XPathExpression {
9903
+ // XPathResult.ANY_TYPE = 0
9904
+ XPathResult evaluate(Node contextNode, optional unsigned short type = 0, optional XPathResult? result = null);
9905
+ };
9906
+ </pre>
9907
+
9908
+
9909
+ <h3 id=mixin-xpathevaluatorbase>Mixin {{XPathEvaluatorBase}}</h3>
9910
+
9911
+ <pre class=idl>
9912
+ callback interface XPathNSResolver {
9913
+ DOMString? lookupNamespaceURI(DOMString? prefix);
9914
+ };
9915
+
9916
+ interface mixin XPathEvaluatorBase {
9917
+ [NewObject] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null);
9918
+ XPathNSResolver createNSResolver(Node nodeResolver);
9919
+ // XPathResult.ANY_TYPE = 0
9920
+ XPathResult evaluate(DOMString expression, Node contextNode, optional XPathNSResolver? resolver = null, optional unsigned short type = 0, optional XPathResult? result = null);
9921
+ };
9922
+ Document includes XPathEvaluatorBase;
9923
+ </pre>
9924
+
9925
+
9926
+ <h3 id=interface-xpathevaluator>Interface {{XPathEvaluator}}</h3>
9927
+
9928
+ <pre class=idl>
9929
+ [Exposed=Window, Constructor]
9930
+ interface XPathEvaluator {};
9931
+
9932
+ XPathEvaluator includes XPathEvaluatorBase;
9933
+ </pre>
9934
+
9935
+ <p class=note> For historical reasons you can both construct {{XPathEvaluator}} and access the same
9936
+ methods on {{Document}} .
9937
+
9938
+
9939
+
9858
9940
<h2 id=historical>Historical</h2>
9859
9941
9860
9942
<p> As explained in <a href="#goals">goals</a> this standard is a significant revision of various
0 commit comments