summaryrefslogtreecommitdiff
path: root/test/testcases/tests/level3/xpath
diff options
context:
space:
mode:
Diffstat (limited to 'test/testcases/tests/level3/xpath')
-rw-r--r--test/testcases/tests/level3/xpath/.cvsignore3
-rw-r--r--test/testcases/tests/level3/xpath/Attribute_Nodes.xml118
-rw-r--r--test/testcases/tests/level3/xpath/Attribute_Nodes_xmlns.xml94
-rw-r--r--test/testcases/tests/level3/xpath/CVS/Entries70
-rw-r--r--test/testcases/tests/level3/xpath/CVS/Repository1
-rw-r--r--test/testcases/tests/level3/xpath/CVS/Root1
-rw-r--r--test/testcases/tests/level3/xpath/CVS/Template0
-rw-r--r--test/testcases/tests/level3/xpath/Comment_Nodes.xml104
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_Expressions.xml280
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_ID.xml98
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_hasFeature_3.xml47
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_hasFeature_empty.xml47
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_hasFeature_null.xml48
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_isSupported_3.xml46
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_isSupported_empty.xml48
-rw-r--r--test/testcases/tests/level3/xpath/Conformance_isSupported_null.xml45
-rw-r--r--test/testcases/tests/level3/xpath/Element_Nodes.xml104
-rw-r--r--test/testcases/tests/level3/xpath/Processing_Instruction_Nodes.xml105
-rw-r--r--test/testcases/tests/level3/xpath/Text_Nodes.xml150
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluatorCast01.xml36
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.xml50
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_01.xml49
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_02.xml55
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NS.xml53
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_no_NS.xml46
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_all.xml110
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_document.xml44
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_documentElement.xml48
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.xml56
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NAMESPACE_ERR.xml57
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.xml58
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.xml44
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR.xml60
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_document.xml46
-rw-r--r--test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_documentElement.xml46
-rw-r--r--test/testcases/tests/level3/xpath/XPathExpression_evaluate_NOT_SUPPORTED_ERR.xml64
-rw-r--r--test/testcases/tests/level3/xpath/XPathExpression_evaluate_WRONG_DOCUMENT_ERR.xml66
-rw-r--r--test/testcases/tests/level3/xpath/XPathExpression_evaluate_document.xml58
-rw-r--r--test/testcases/tests/level3/xpath/XPathExpression_evaluate_documentElement.xml62
-rw-r--r--test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_nist_dmstc.xml119
-rw-r--r--test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_null.xml86
-rw-r--r--test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_prefix.xml99
-rw-r--r--test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_xml.xml88
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_TYPE_ERR.xml457
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_booleanValue_false.xml100
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_booleanValue_true.xml100
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_BOOLEAN_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_NUMBER_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.xml116
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_STRING_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.xml116
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE.xml108
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_iterateNext_INVALID_STATE_ERR.xml113
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE.xml160
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE.xml112
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_numberValue.xml95
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_resultType.xml179
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE.xml99
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE.xml100
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null.xml101
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order.xml151
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count.xml114
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null.xml101
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE.xml98
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE.xml98
-rw-r--r--test/testcases/tests/level3/xpath/XPathResult_stringValue.xml97
-rw-r--r--test/testcases/tests/level3/xpath/alltests.xml89
-rw-r--r--test/testcases/tests/level3/xpath/dom3xpathents.ent16
-rw-r--r--test/testcases/tests/level3/xpath/files/CVS/Entries11
-rw-r--r--test/testcases/tests/level3/xpath/files/CVS/Repository1
-rw-r--r--test/testcases/tests/level3/xpath/files/CVS/Root1
-rw-r--r--test/testcases/tests/level3/xpath/files/CVS/Template0
-rw-r--r--test/testcases/tests/level3/xpath/files/internaldtd.svg29
-rw-r--r--test/testcases/tests/level3/xpath/files/internaldtd.xml12
-rw-r--r--test/testcases/tests/level3/xpath/files/staff.dtd17
-rw-r--r--test/testcases/tests/level3/xpath/files/staff.svg72
-rw-r--r--test/testcases/tests/level3/xpath/files/staff.xml57
-rw-r--r--test/testcases/tests/level3/xpath/files/staffNS.dtd47
-rw-r--r--test/testcases/tests/level3/xpath/files/staffNS.svg73
-rw-r--r--test/testcases/tests/level3/xpath/files/staffNS.xml44
-rw-r--r--test/testcases/tests/level3/xpath/files/svgtest.js0
-rw-r--r--test/testcases/tests/level3/xpath/files/svgunit.js0
-rw-r--r--test/testcases/tests/level3/xpath/metadata.xml19
87 files changed, 6768 insertions, 0 deletions
diff --git a/test/testcases/tests/level3/xpath/.cvsignore b/test/testcases/tests/level3/xpath/.cvsignore
new file mode 100644
index 0000000..182530a
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/.cvsignore
@@ -0,0 +1,3 @@
+dom3.dtd
+dom3.xsd
+test-to-html.xsl
diff --git a/test/testcases/tests/level3/xpath/Attribute_Nodes.xml b/test/testcases/tests/level3/xpath/Attribute_Nodes.xml
new file mode 100644
index 0000000..0e45a09
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Attribute_Nodes.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Attribute_Nodes">
+ <metadata>
+ <title>Attribute_Nodes</title>
+ <creator>Bob Clary</creator>
+ <description>
+ S1.2.2 Attribute Nodes -
+ Create ANY_TYPE XPathResult matching //@*,
+ check that each matching Node is an Attribute Node,
+ that parentNodes of returned Attributes are null,
+ and that ownerElements are in fact Elements.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Mapping"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;//@*&quot;" />
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+ <var name="parent" type="Node"/>
+ <var name="owner" type="Node"/>
+ <var name="ownerType" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="outNode" obj="outresult"/>
+ <while>
+ <notNull obj="outNode"/>
+
+ <nodeType var="nodeType" obj="outNode" />
+ <assertEquals id="S1.2.2-Attribute-Nodes-nodeType"
+ actual="nodeType"
+ expected="2"
+ ignoreCase="false"/>
+
+ <parentNode var="parent" obj="outNode" interface="Node"/>
+ <assertNull id="S1.2.2-Attribute-Nodes-parentNode" actual="parent"/>
+
+ <ownerElement var="owner" obj="outNode" interface="Attr"/>
+ <nodeType var="ownerType" obj="owner"/>
+ <assertEquals id="S1.2.2-Attribute-Nodes-owner-nodeType"
+ actual="ownerType"
+ expected="1"
+ ignoreCase="false"/>
+
+ <iterateNext var="outNode" obj="outresult"/>
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Attribute_Nodes_xmlns.xml b/test/testcases/tests/level3/xpath/Attribute_Nodes_xmlns.xml
new file mode 100644
index 0000000..ed854ba
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Attribute_Nodes_xmlns.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Attribute_Nodes_xmlns">
+ <metadata>
+ <title>Attribute_Nodes_xmlns</title>
+ <creator>Bob Clary</creator>
+ <description>
+ S1.2.2 Attribute Nodes -
+ Create ANY_TYPE XPathResult matching //@xmlns,
+ check that there are no matching Nodes by
+ checking for XPathResult.iterateNext == null
+ since namespace attributes are not retrievable.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Mapping"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;//@xmlns&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="outNode" obj="outresult"/>
+ <assertNull id="Attribute_Nodes_xmlnsxmlns" actual="outNode"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/CVS/Entries b/test/testcases/tests/level3/xpath/CVS/Entries
new file mode 100644
index 0000000..8d355b2
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/CVS/Entries
@@ -0,0 +1,70 @@
+D/files////
+/.cvsignore/1.1/Fri Apr 3 02:47:58 2009//
+/Attribute_Nodes.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Attribute_Nodes_xmlns.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Comment_Nodes.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Conformance_Expressions.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Conformance_ID.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Conformance_hasFeature_3.xml/1.1/Fri Apr 3 02:47:58 2009//
+/Conformance_hasFeature_empty.xml/1.1/Fri Apr 3 02:47:58 2009//
+/Conformance_hasFeature_null.xml/1.1/Fri Apr 3 02:47:58 2009//
+/Conformance_isSupported_3.xml/1.1/Fri Apr 3 02:47:58 2009//
+/Conformance_isSupported_empty.xml/1.1/Fri Apr 3 02:47:58 2009//
+/Conformance_isSupported_null.xml/1.1/Fri Apr 3 02:47:58 2009//
+/Element_Nodes.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Processing_Instruction_Nodes.xml/1.2/Fri Apr 3 02:47:58 2009//
+/Text_Nodes.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathEvaluatorCast01.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createExpression_NAMESPACE_ERR_01.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createExpression_NAMESPACE_ERR_02.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createExpression_NS.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createExpression_no_NS.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createNSResolver_all.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createNSResolver_document.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_createNSResolver_documentElement.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_NAMESPACE_ERR.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_TYPE_ERR.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_document.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathEvaluator_evaluate_documentElement.xml/1.1/Fri Apr 3 02:47:58 2009//
+/XPathExpression_evaluate_NOT_SUPPORTED_ERR.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathExpression_evaluate_WRONG_DOCUMENT_ERR.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathExpression_evaluate_document.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathExpression_evaluate_documentElement.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathNSResolver_lookupNamespaceURI_nist_dmstc.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathNSResolver_lookupNamespaceURI_null.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathNSResolver_lookupNamespaceURI_prefix.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathNSResolver_lookupNamespaceURI_xml.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_TYPE_ERR.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_booleanValue_false.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_booleanValue_true.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_ANY_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_BOOLEAN_TYPE.xml/1.4/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_NUMBER_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_STRING_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_iterateNext_INVALID_STATE_ERR.xml/1.3/Fri Apr 3 02:47:58 2009//
+/XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_numberValue.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_resultType.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE.xml/1.2/Fri Apr 3 02:47:58 2009//
+/XPathResult_stringValue.xml/1.3/Fri Apr 3 02:47:58 2009//
+/alltests.xml/1.6/Fri Apr 3 02:47:58 2009//
+/dom3xpathents.ent/1.4/Fri Apr 3 02:47:58 2009//
+/metadata.xml/1.2/Fri Apr 3 02:47:58 2009//
diff --git a/test/testcases/tests/level3/xpath/CVS/Repository b/test/testcases/tests/level3/xpath/CVS/Repository
new file mode 100644
index 0000000..8a011cd
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/CVS/Repository
@@ -0,0 +1 @@
+2001/DOM-Test-Suite/tests/level3/xpath
diff --git a/test/testcases/tests/level3/xpath/CVS/Root b/test/testcases/tests/level3/xpath/CVS/Root
new file mode 100644
index 0000000..3c7177e
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.w3.org:/sources/public
diff --git a/test/testcases/tests/level3/xpath/CVS/Template b/test/testcases/tests/level3/xpath/CVS/Template
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/CVS/Template
diff --git a/test/testcases/tests/level3/xpath/Comment_Nodes.xml b/test/testcases/tests/level3/xpath/Comment_Nodes.xml
new file mode 100644
index 0000000..51f7cbe
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Comment_Nodes.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Comment_Nodes">
+ <metadata>
+ <title>Comment_Nodes</title>
+ <creator>Bob Clary</creator>
+ <description>
+ S1.2.6 Comment Nodes -
+ Create ANY_TYPE XPathResult matching //comment(),
+ check that each matching Node is a Comment Node.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Mapping"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;//comment()&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="currNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="currNode" obj="outresult"/>
+ <while>
+ <notNull obj="currNode"/>
+
+ <nodeType var="nodeType" obj="currNode" />
+ <assertEquals id="S1.2.6-Comment-Nodes-nodeType"
+ actual="nodeType"
+ expected="8"
+ ignoreCase="false"/>
+
+ <iterateNext var="currNode" obj="outresult"/>
+
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_Expressions.xml b/test/testcases/tests/level3/xpath/Conformance_Expressions.xml
new file mode 100644
index 0000000..d3d1f38
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_Expressions.xml
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_Expressions">
+ <metadata>
+ <title>Conformance_Expressions</title>
+ <creator>Bob Clary</creator>
+ <description>
+ 1.3 Conformance - Iterate over a list of strings containing
+ valid XPath expressions, calling XPathEvaluator.createExpression
+ for each. If no expections are thrown and each result is non-null,
+ then the test passes.
+ </description>
+ <date qualifier="created">2003-11-18</date>
+ <subject resource="&spec;#Conformance"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="doc" type="Document"/>
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="evaluator" type="XPathEvaluator"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString"/>
+
+ <!-- Test Variables -->
+
+ <var name="expressionList" type="List"/>
+ <var name="xpathexpression" type="XPathExpression"/>
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <createXPathEvaluator var='evaluator' document='doc'/>
+
+ <createNSResolver var="resolver" obj="evaluator" nodeResolver="doc"/>
+
+ <!-- test root absolute expression -->
+ <append collection="expressionList" item="&quot;/&quot;"/>
+
+ <!-- test verbose axes and basic node tests -->
+ <append collection="expressionList" item="&quot;child::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;child::text()&quot;"/>
+ <append collection="expressionList" item="&quot;child::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;child::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;child::node()&quot;"/>
+ <append collection="expressionList" item="&quot;child::*&quot;"/>
+ <append collection="expressionList" item="&quot;child::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;child::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;descendant::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::text()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::node()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::*&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;descendant::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;parent::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;parent::text()&quot;"/>
+ <append collection="expressionList" item="&quot;parent::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;parent::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;parent::node()&quot;"/>
+ <append collection="expressionList" item="&quot;parent::*&quot;"/>
+ <append collection="expressionList" item="&quot;parent::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;parent::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;ancestor::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::text()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::node()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::*&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;following-sibling::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::text()&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::node()&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::*&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;following-sibling::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;preceding-sibling::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::text()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::node()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::*&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;preceding-sibling::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;following::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;following::text()&quot;"/>
+ <append collection="expressionList" item="&quot;following::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;following::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;following::node()&quot;"/>
+ <append collection="expressionList" item="&quot;following::*&quot;"/>
+ <append collection="expressionList" item="&quot;following::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;following::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;preceding::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::text()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::node()&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::*&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;preceding::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;attribute::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::text()&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::node()&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::*&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;attribute::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;namespace::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::text()&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::node()&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::*&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;namespace::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;self::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;self::text()&quot;"/>
+ <append collection="expressionList" item="&quot;self::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;self::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;self::node()&quot;"/>
+ <append collection="expressionList" item="&quot;self::*&quot;"/>
+ <append collection="expressionList" item="&quot;self::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;self::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;descendant-or-self::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::text()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::node()&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::*&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;descendant-or-self::employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;ancestor-or-self::comment()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::text()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::node()&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::*&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;ancestor-or-self::employee&quot;"/>
+
+ <!-- test common abbreviations -->
+ <append collection="expressionList" item="&quot;comment()&quot;"/>
+ <append collection="expressionList" item="&quot;text()&quot;"/>
+ <append collection="expressionList" item="&quot;processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;node()&quot;"/>
+ <append collection="expressionList" item="&quot;*&quot;"/>
+ <append collection="expressionList" item="&quot;nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;.//comment()&quot;"/>
+ <append collection="expressionList" item="&quot;.//text()&quot;"/>
+ <append collection="expressionList" item="&quot;.//processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;.//processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;.//node()&quot;"/>
+ <append collection="expressionList" item="&quot;.//*&quot;"/>
+ <append collection="expressionList" item="&quot;.//nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;.//employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;../comment()&quot;"/>
+ <append collection="expressionList" item="&quot;../text()&quot;"/>
+ <append collection="expressionList" item="&quot;../processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;../processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;../node()&quot;"/>
+ <append collection="expressionList" item="&quot;../*&quot;"/>
+ <append collection="expressionList" item="&quot;../nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;../employee&quot;"/>
+
+ <append collection="expressionList" item="&quot;@attributename&quot;"/>
+
+ <append collection="expressionList" item="&quot;./comment()&quot;"/>
+ <append collection="expressionList" item="&quot;./text()&quot;"/>
+ <append collection="expressionList" item="&quot;./processing-instruction()&quot;"/>
+ <append collection="expressionList" item="&quot;./processing-instruction('name')&quot;"/>
+ <append collection="expressionList" item="&quot;./node()&quot;"/>
+ <append collection="expressionList" item="&quot;./*&quot;"/>
+ <append collection="expressionList" item="&quot;./nist:*&quot;"/>
+ <append collection="expressionList" item="&quot;./employee&quot;"/>
+
+ <!-- test Union -->
+ <append collection="expressionList" item="&quot;comment() | text() | processing-instruction() | node()&quot;"/>
+
+ <!-- test various predicates -->
+
+ <append collection="expressionList" item="&quot;employee[address]&quot;"/>
+ <append collection="expressionList" item="&quot;employee/address[@street]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position='Computer Specialist']&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position!='Computer Specialist']&quot;"/>
+ <append collection="expressionList" item="&quot;employee[gender='Male' or gender='Female']&quot;"/>
+ <append collection="expressionList" item="&quot;employee[gender!='Male' and gender!='Female']&quot;"/>
+ <append collection="expressionList" item="&quot;employee/address[@street='Yes']&quot;"/>
+ <append collection="expressionList" item="&quot;employee/address[@street!='Yes']&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position()=1]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[1]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position()=last()]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[last()]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position()&gt;1 and position&lt;last()]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position()&gt;=1 and position&lt;=last()]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[count(.)&gt;0]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position() mod 2=0]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position() mod -2=0]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position() div 2=0]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position() div -2=-1]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[position() div 2 * 2=position()]&quot;"/>
+ <append collection="expressionList" item="&quot;employee[3 &gt; 2 &gt; 1]&quot;"/>
+ <append collection="expressionList" item="&quot;id('CANADA')&quot;"/>
+ <append collection="expressionList" item="&quot;*[local-name()='employee']&quot;"/>
+ <append collection="expressionList" item="&quot;*[local-name(.)='employee']&quot;"/>
+ <append collection="expressionList" item="&quot;*[local-name(employee)='employee']&quot;"/>
+ <append collection="expressionList" item="&quot;*[local-name()='employee']&quot;"/>
+ <append collection="expressionList" item="&quot;*[namespace-uri()='http://www.nist.gov']&quot;"/>
+ <append collection="expressionList" item="&quot;*[name()='nist:employee']&quot;"/>
+ <append collection="expressionList" item="&quot;*[string()]&quot;"/>
+ <append collection="expressionList" item="&quot;*[string(10 div foo)='NaN']&quot;"/>
+ <append collection="expressionList" item="&quot;*[concat('a', 'b', 'c')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[starts-with('employee', 'emp')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[contains('employee', 'emp')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[substring-before('employeeId', 'Id')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[substring-after('employeeId', 'employee')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[substring('employeeId', 4)]&quot;"/>
+ <append collection="expressionList" item="&quot;*[substring('employeeId', 4, 5)]&quot;"/>
+ <append collection="expressionList" item="&quot;*[string-length()=2]&quot;"/>
+ <append collection="expressionList" item="&quot;*[string-length(.)=string-length(normalize-space(.))]&quot;"/>
+ <append collection="expressionList" item="&quot;*[translate('bar', 'abc', 'ABC')='BAr']&quot;"/>
+ <append collection="expressionList" item="&quot;*[boolean(.)]&quot;"/>
+ <append collection="expressionList" item="&quot;*[not(boolean(.))]&quot;"/>
+ <append collection="expressionList" item="&quot;*[true()]&quot;"/>
+ <append collection="expressionList" item="&quot;*[false()]&quot;"/>
+ <append collection="expressionList" item="&quot;*[lang('en')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[number()]&quot;"/>
+ <append collection="expressionList" item="&quot;*[number('4')]&quot;"/>
+ <append collection="expressionList" item="&quot;*[floor(.)]&gt;0&quot;"/>
+ <append collection="expressionList" item="&quot;*[ceiling(.)]&lt;1&quot;"/>
+ <append collection="expressionList" item="&quot;*[round(number(.))=0]&lt;1&quot;"/>
+
+ <for-each collection="expressionList" member="expression">
+ <createExpression var="xpathexpression"
+ obj="evaluator"
+ resolver="resolver"
+ expression="expression"/>
+ </for-each>
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_ID.xml b/test/testcases/tests/level3/xpath/Conformance_ID.xml
new file mode 100644
index 0000000..bc288da
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_ID.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_ID">
+ <metadata>
+ <title>Conformance_ID</title>
+ <creator>Bob Clary</creator>
+ <description>
+ 1.3 Conformance - Check that the element returned by XPath id() function
+ returns the same element as Document.getElementById
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Conformance"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document"/>
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="evaluator" type="XPathEvaluator"/>
+ <var name="contextNode" type="Node"/>
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;id('child1')&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE"/>
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="child1Element" type="Node"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="internaldtd" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="outNode" obj="outresult"/>
+
+ <getElementById var="child1Element"
+ obj="doc"
+ elementId="&quot;child1&quot;"/>
+
+ <assertSame id="S1.3-Conformance-ID"
+ actual="outNode"
+ expected="child1Element"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_hasFeature_3.xml b/test/testcases/tests/level3/xpath/Conformance_hasFeature_3.xml
new file mode 100644
index 0000000..be0e75c
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_hasFeature_3.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_hasFeature_3">
+ <metadata>
+ <title>Conformance_hasFeature_3</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ 1.3 Conformance - Test if
+ Document.implementation.hasFeature('XPath', "3.0") returns true
+ </description>
+ <date qualifier="created">2003-11-29</date>
+ <subject resource="&spec;#Conformance"/>
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="state" type="boolean"/>
+ <var name="impl" type='DOMImplementation'/>
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <implementation obj="doc" var="impl"/>
+
+ <hasFeature obj="impl"
+ feature="&quot;xpATH&quot;"
+ version="&quot;3.0&quot;"
+ var="state"/>
+
+ <assertTrue actual="state" id="hasFeature-XPath-3.0"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_hasFeature_empty.xml b/test/testcases/tests/level3/xpath/Conformance_hasFeature_empty.xml
new file mode 100644
index 0000000..362588a
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_hasFeature_empty.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_hasFeature_empty">
+ <metadata>
+ <title>Conformance_hasFeature_empty</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ 1.3 Conformance - Test if
+ Document.implementation.hasFeature('XPath', "") returns true
+ </description>
+ <date qualifier="created">2003-11-29</date>
+ <subject resource="&spec;#Interfaces"/>
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="state" type="boolean"/>
+ <var name="impl" type='DOMImplementation'/>
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <implementation obj="doc" var="impl"/>
+
+ <hasFeature obj="impl"
+ feature="&quot;xpATH&quot;"
+ version="&quot;&quot;"
+ var="state"/>
+
+ <assertTrue actual="state" id="hasFeature-XPath-empty"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_hasFeature_null.xml b/test/testcases/tests/level3/xpath/Conformance_hasFeature_null.xml
new file mode 100644
index 0000000..c69dedc
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_hasFeature_null.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_hasFeature_null">
+ <metadata>
+ <title>Conformance_hasFeature_null</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ 1.3 Conformance - Test if
+ Document.implementation.hasFeature('XPath', null) returns true
+ </description>
+ <date qualifier="created">2003-11-29</date>
+ <subject resource="&spec;#Conformance"/>
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="state" type="boolean"/>
+ <var name="impl" type='DOMImplementation'/>
+ <var name="nullValue" type="DOMString" isNull="true"/>
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <implementation obj="doc" var="impl"/>
+
+ <hasFeature obj="impl"
+ feature="&quot;xpATH&quot;"
+ version="nullValue"
+ var="state"/>
+
+ <assertTrue actual="state" id="hasFeature-XPath-null"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_isSupported_3.xml b/test/testcases/tests/level3/xpath/Conformance_isSupported_3.xml
new file mode 100644
index 0000000..c5d3459
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_isSupported_3.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_isSupported_3">
+ <metadata>
+ <title>Conformance_isSupported_3</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ 1.3 Conformance - The "feature" parameter in the
+ "Node.isSupported(feature,version)"
+ method is the name of the feature and the version is the version
+ number of the feature to test. XPath is the legal value for the
+ XPath module. The method should return "true".
+
+ Retrieve the DOM document on which the
+ "isSupported(feature,version)" method is invoked with "feature"
+ equal to "XPath" and version to "3.0". The method should return a
+ boolean "true".
+ </description>
+ <date qualifier="created">2002-04-24</date>
+ <date qualifier="modified">2003-11-29</date>
+ <subject resource="&spec;#Conformance"/>
+ </metadata>
+ <var name="doc" type="Document"/>
+ <var name="state" type="boolean"/>
+ <load var="doc" href="staffNS" willBeModified="false"/>
+ <isSupported obj="doc" feature="&quot;xpATH&quot;"
+ version="&quot;3.0&quot;" var="state"/>
+ <assertTrue actual="state" id="isSupported-XPath-3.0"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_isSupported_empty.xml b/test/testcases/tests/level3/xpath/Conformance_isSupported_empty.xml
new file mode 100644
index 0000000..d441cbe
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_isSupported_empty.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_isSupported_empty">
+ <metadata>
+ <title>Conformance_isSupported_empty</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ 1.3 Conformance - The "feature" parameter in the
+ "Node.isSupported(feature,version)"
+ method is the name of the feature and the version is the version
+ number of the feature to test. XPath is the legal value for the
+ XPath module. The method should return "true".
+
+ Retrieve the DOM document on which the
+ "isSupported(feature,version)" method is invoked with "feature"
+ equal to "XPath" and version to the empty string "". The method
+ should return a boolean "true" if the implementation claims support
+ for some version for XPath.
+ </description>
+ <date qualifier="created">2002-04-24</date>
+ <date qualifier="modified">2003-11-29</date>
+ <subject resource="&spec;#Conformance"/>
+ </metadata>
+ <var name="doc" type="Document"/>
+ <var name="state" type="boolean"/>
+ <load var="doc" href="staffNS" willBeModified="false"/>
+ <isSupported obj="doc" feature="&quot;xpATH&quot;"
+ version="&quot;&quot;" var="state"/>
+ <assertTrue actual="state" id="isSupported-XPath-empty"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Conformance_isSupported_null.xml b/test/testcases/tests/level3/xpath/Conformance_isSupported_null.xml
new file mode 100644
index 0000000..a88377f
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Conformance_isSupported_null.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Conformance_isSupported_null">
+ <metadata>
+ <title>Conformance_isSupported_null</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ 1.3 Conformance - Test if
+ Document.isSupported('XPath', null) returns true
+ </description>
+ <date qualifier="created">2003-11-29</date>
+ <subject resource="&spec;#Conformance"/>
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="state" type="boolean"/>
+ <var name="nullValue" type="DOMString" isNull="true"/>
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <isSupported obj="doc"
+ feature="&quot;xpATH&quot;"
+ version="nullValue"
+ var="state"/>
+
+ <assertTrue actual="state" id="isSupported-XPath-null"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Element_Nodes.xml b/test/testcases/tests/level3/xpath/Element_Nodes.xml
new file mode 100644
index 0000000..9809277
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Element_Nodes.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Element_Nodes">
+ <metadata>
+ <title>Element_Nodes</title>
+ <creator>Bob Clary</creator>
+ <description>
+ 1.2.1- Element Nodes - Evaluate /staff/employee,
+ check that each matching Node in the result
+ is an Element.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Mapping"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document"/>
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="evaluator" type="XPathEvaluator"/>
+ <var name="contextNode" type="Node"/>
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE"/>
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="outNode" obj="outresult"/>
+ <while>
+ <notNull obj="outNode"/>
+
+ <nodeType var="nodeType" obj="outNode" />
+ <assertEquals id="S1.2.1-Element-Nodes-nodeType"
+ actual="nodeType"
+ expected="1"
+ ignoreCase="false"/>
+ <iterateNext var="outNode" obj="outresult"/>
+
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Processing_Instruction_Nodes.xml b/test/testcases/tests/level3/xpath/Processing_Instruction_Nodes.xml
new file mode 100644
index 0000000..cc98ea0
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Processing_Instruction_Nodes.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Processing_Instruction_Nodes">
+ <metadata>
+ <title>Processing_Instruction_Nodes</title>
+ <creator>Bob Clary</creator>
+ <description>
+ S1.2.7 Processing Instruction Nodes -
+ Create ANY_TYPE XPathResult matching //processing-instruction(),
+ check that each matching Node is a Processing Instruction Node.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Mapping"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString"
+ value="&quot;//processing-instruction()&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="currNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="currNode" obj="outresult"/>
+ <while>
+ <notNull obj="currNode"/>
+
+ <nodeType var="nodeType" obj="currNode" />
+ <assertEquals id="S1.2.7-Processing-Instruction-Nodes-nodetype"
+ actual="nodeType"
+ expected="7"
+ ignoreCase="false"/>
+
+ <iterateNext var="currNode" obj="outresult"/>
+
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/Text_Nodes.xml b/test/testcases/tests/level3/xpath/Text_Nodes.xml
new file mode 100644
index 0000000..4897c12
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/Text_Nodes.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="Text_Nodes">
+ <metadata>
+ <title>Text_Nodes</title>
+ <creator>Bob Clary</creator>
+ <description>
+ 1.2.4 Text Nodes -
+ Create ANY_TYPE XPathResult matching //text(),
+ check that each matching Node is a Text Node, and
+ that no pair of nodes in the result are siblings.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#Mapping"/>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;//text()&quot;" />
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="currNode" type="Node"/>
+ <var name="nextNode" type="Node"/>
+ <var name="currNodeNextSibling" type="Node"/>
+ <var name="nextNodePrevSibling" type="Node"/>
+ <var name="nodeType" type="int"/>
+ <var name="isTextNode" type="DOMString" />
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc" />
+ <createNSResolver var="resolver" obj="evaluator" nodeResolver="doc" />
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator" />
+
+ <!-- Test Body -->
+
+ <iterateNext var="currNode" obj="outresult" />
+
+ <while> <notNull obj="currNode"/>
+
+ <nodeType var="nodeType" obj="currNode" />
+
+ <assign var="isTextNode" value="&quot;true&quot;"/>
+ <if>
+ <and>
+ <notEquals actual="nodeType" expected="3"/>
+ <notEquals actual="nodeType" expected="4"/>
+ </and>
+
+ <assign var="isTextNode" value="&quot;false&quot;"/>
+ </if>
+ <assertEquals id="S1.2.4-Text-Nodes-nodeType"
+ actual="isTextNode"
+ expected="&quot;true&quot;"
+ ignoreCase="true"/>
+
+ <iterateNext var="nextNode" obj="outresult"/>
+
+ <if>
+ <notNull obj="nextNode"/>
+
+ <nextSibling var="currNodeNextSibling"
+ obj="currNode" interface="Node"/>
+ <if>
+ <same actual="currNodeNextSibling" expected="nextNode"/>
+ <comment>dummy statement</comment>
+ <else>
+ <assertTrue id="S1.2.4-Text-Nodes-Adjacent-Next"
+ actual="false"
+ />
+ </else>
+ </if>
+
+ <previousSibling var="nextNodePrevSibling"
+ obj="nextNode" interface="Node"/>
+ <if>
+ <same actual="currNode" expected="nextNodePrevSibling"/>
+ <comment>dummy statement</comment>
+ <else>
+ <assertTrue id="S1.2.4-Text-Nodes-Adjacent-Prev"
+ actual="false"
+ />
+ </else>
+ </if>
+
+ </if>
+
+ <assign var="currNode" value="nextNode"/>
+
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluatorCast01.xml b/test/testcases/tests/level3/xpath/XPathEvaluatorCast01.xml
new file mode 100644
index 0000000..e0cf751
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluatorCast01.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluatorCast01">
+<metadata>
+<title>XPathEvaluatorCast01</title>
+<creator>Philippe Le Hégaret</creator>
+<description>
+A document is created using implementation.createDocument and
+cast to a XPathEvaluator interface.
+</description>
+<date qualifier="created">2002-04-24</date>
+<subject resource="&spec;#XPathEvaluator"/>
+</metadata>
+ &vars;
+
+ &findXPathEvaluator;
+
+ <assertNotNull actual="xpEvaluator" id="notnull"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.xml
new file mode 100644
index 0000000..c477127
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR">
+ <metadata>
+ <title>XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create a "XPathExpression" using the method
+ "createExpression(expression, resolver)".
+
+ Retrieve the DOM document on which the
+ 'createExpression("12a", null)' method is
+ invoked with the document element. The method should fail to create
+ pre-compiled expression and throws
+ XPathException.INVALID_EXPRESSION_ERR
+ since "12a" is not an XPath expression.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ </metadata>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ &vars;
+ <var name="exp" type="XPathExpression"/>
+
+ &findXPathEvaluator;
+
+ <assertXPathException id="throw_INVALID_EXPRESSION_ERR">
+ <INVALID_EXPRESSION_ERR>
+ <createExpression obj='xpEvaluator' var='exp'
+ expression='&quot;12a&quot;' resolver='nullNSResolver' />
+ </INVALID_EXPRESSION_ERR>
+ </assertXPathException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_01.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_01.xml
new file mode 100644
index 0000000..d909308
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_01.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createExpression_NAMESPACE_ERR_01">
+ <metadata>
+ <title>XPathEvaluator_createExpression_NAMESPACE_ERR_01</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create a "XPathExpression" using the method
+ "createExpression(expression, resolver)".
+
+ Retrieve the DOM document on which the
+ 'createExpression("/jfouffa:employee", null)' method is
+ invoked with the document element. The method should fail to create
+ pre-compiled expression and throws DOMException.NAMESPACE_ERR
+ since the prefix jfouffa is not mapped.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ </metadata>
+ &vars;
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="exp" type="XPathExpression"/>
+
+ &findXPathEvaluator;
+
+ <assertDOMException id="throw_NAMESPACE_ERR">
+ <NAMESPACE_ERR>
+ <createExpression obj='xpEvaluator' var='exp'
+ expression='&quot;/jfouffa:employee&quot;' resolver='nullNSResolver' />
+ </NAMESPACE_ERR>
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_02.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_02.xml
new file mode 100644
index 0000000..5a197ed
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_02.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createExpression_NAMESPACE_ERR_02">
+ <metadata>
+ <title>XPathEvaluator_createExpression_NAMESPACE_ERR_02</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create a "XPathExpression" using the method
+ "createExpression(expression, resolver)".
+
+ Retrieve the DOM document on which the
+ 'createExpression("/staff/jfouffa:employee", resolver)' method is
+ invoked with the document element. The method should fail to create
+ pre-compiled expression and throws DOMException.NAMESPACE_ERR
+ since the prefix jfouffa is not mapped.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ </metadata>
+ &vars;
+ <var name="exp" type="XPathExpression"/>
+ <var name="root" type='Element'/>
+ <var name="resolver" type="XPathNSResolver"/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc' var='root'/>
+
+ <createNSResolver obj="xpEvaluator" nodeResolver="root"
+ var="resolver"/>
+
+ <assertDOMException id="throw_NAMESPACE_ERR">
+ <NAMESPACE_ERR>
+ <createExpression obj='xpEvaluator' var='exp'
+ expression='&quot;/staff/jfouffa:employee&quot;' resolver='resolver' />
+ </NAMESPACE_ERR>
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NS.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NS.xml
new file mode 100644
index 0000000..0f66b72
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_NS.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createExpression_NS">
+ <metadata>
+ <title>XPathEvaluator_createExpression_NS</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create a "XPathExpression" using the method
+ "createExpression(expression, resolver)".
+
+ Retrieve the DOM document on which the
+ 'createExpression("/staff/nist:employee", resolver)' method is
+ invoked with the document element. The method should return a
+ pre-compiled expression.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ </metadata>
+ &vars;
+ <var name="exp" type="XPathExpression"/>
+ <var name="root" type='Element'/>
+ <var name="resolver" type="XPathNSResolver"/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc' var='root'/>
+
+ <createNSResolver obj="xpEvaluator" nodeResolver="root"
+ var="resolver"/>
+
+ <createExpression obj='xpEvaluator' var='exp'
+ expression='&quot;/staff/nist:employee&quot;' resolver='resolver' />
+
+ <assertNotNull actual="exp" id="notnull"/>
+
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_no_NS.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_no_NS.xml
new file mode 100644
index 0000000..862f2ba
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createExpression_no_NS.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createExpression_no_NS">
+ <metadata>
+ <title>XPathEvaluator_createExpression_no_NS</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create a "XPathExpression" using the method
+ "createExpression(expression, resolver)".
+
+ Retrieve the DOM document on which the
+ "createExpression("/", null)" method is invoked with the document
+ element. The method should return a pre-compiled expression.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ </metadata>
+ &vars;
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="exp" type="XPathExpression"/>
+
+ &findXPathEvaluator;
+
+ <createExpression obj='xpEvaluator' var='exp'
+ expression='&quot;/&quot;' resolver='nullNSResolver' />
+
+ <assertNotNull actual="exp" id="notnull"/>
+
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_all.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_all.xml
new file mode 100644
index 0000000..a4a1b76
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_all.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createNSResolver_all">
+ <metadata>
+ <title>XPathEvaluator_createNSResolver_all</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Iterate over all nodes in the test document, creating
+ XPathNSResolvers checking that none return a null object.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="staff" type="Element"/>
+ <var name="staffchildren" type="NodeList"/>
+ <var name="staffchild" type="Node"/>
+ <var name="staffgrandchildren" type="NodeList"/>
+ <var name="staffgrandchild" type="Node"/>
+ <var name="staffgreatgrandchildren" type="NodeList"/>
+ <var name="staffgreatgrandchild" type="Node"/>
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="evaluator" type="XPathEvaluator"/>
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <createXPathEvaluator var='evaluator'
+ document='doc'/>
+
+ <createNSResolver var="resolver"
+ obj="evaluator"
+ nodeResolver="doc"/>
+
+ <assertNotNull id="documentnotnull"
+ actual="resolver"/>
+
+ <documentElement var="staff"
+ obj="doc"/>
+
+ <createNSResolver var="resolver"
+ obj="evaluator"
+ nodeResolver="staff"/>
+
+ <assertNotNull id="documentElementnotnull"
+ actual="resolver"/>
+
+ <childNodes var="staffchildren"
+ obj="staff"/>
+
+ <for-each member="staffchild"
+ collection="staffchildren">
+
+ <createNSResolver var="resolver"
+ obj="evaluator"
+ nodeResolver="staffchild"/>
+
+ <assertNotNull id="staffchildnotnull"
+ actual="resolver"/>
+
+ <childNodes var="staffgrandchildren"
+ obj="staffchild"/>
+
+ <for-each member="staffgrandchild"
+ collection="staffgrandchildren">
+
+ <createNSResolver var="resolver"
+ obj="evaluator"
+ nodeResolver="staffgrandchild"/>
+
+ <assertNotNull id="staffgrandchildnotnull"
+ actual="resolver"/>
+
+ <childNodes var="staffgreatgrandchildren"
+ obj="staffgrandchild"/>
+
+ <for-each member="staffgreatgrandchild"
+ collection="staffgreatgrandchildren">
+
+ <createNSResolver var="resolver"
+ obj="evaluator"
+ nodeResolver="staffgreatgrandchild"/>
+
+ <assertNotNull id="staffgreatgrandchildnotnull"
+ actual="resolver"/>
+
+ </for-each>
+
+ </for-each>
+
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_document.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_document.xml
new file mode 100644
index 0000000..5d77b39
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_document.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createNSResolver_document">
+ <metadata>
+ <title>XPathEvaluator_createNSResolver_document</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create "XPathNSResolver" using the method
+ "createNSResolver(nodeResolver)".
+
+ Retrieve the DOM document on which the
+ "createNSResolver(nodeResolver)" method is invoked with the document
+ itself. The method should return a resolver.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+ &vars;
+ <var name="resolver" type="XPathNSResolver"/>
+
+ &findXPathEvaluator;
+
+ <createNSResolver obj="xpEvaluator" nodeResolver="doc" var="resolver"/>
+
+ <assertNotNull actual="resolver" id="notnull"/>
+
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_documentElement.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_documentElement.xml
new file mode 100644
index 0000000..263cd54
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_createNSResolver_documentElement.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_createNSResolver_documentElement">
+ <metadata>
+ <title>XPathEvaluator_createNSResolver_documentElement</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ The XPathEvaluator can create "XPathNSResolver" using the method
+ "createNSResolver(nodeResolver)".
+
+ Retrieve the DOM document on which the
+ "createNSResolver(nodeResolver)" method is invoked with the document
+ element. The method should return a resolver.
+ </description>
+ <date qualifier="created">2002-04-26</date>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+ &vars;
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="root" type='Element'/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc' var='root'/>
+
+ <createNSResolver obj="xpEvaluator" nodeResolver="root"
+ var="resolver"/>
+
+ <assertNotNull actual="resolver" id="notnull"/>
+
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.xml
new file mode 100644
index 0000000..51b4de4
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR">
+ <metadata>
+ <title>XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ Test if XPathEvaluator.evaluate properly throws INVALID_EXPRESSION_ERROR
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ </metadata>
+
+ &vars;
+
+ <var name="root" type='Element'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc' var='root'/>
+
+ <assertXPathException id="throw_INVALID_EXPRESSION_ERR">
+ <INVALID_EXPRESSION_ERR>
+ <evaluate interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='result'
+ expression='&quot;12a&quot;'
+ contextNode='root'
+ resolver='nullNSResolver'
+ type='0'
+ result='nullResult'/>
+ </INVALID_EXPRESSION_ERR>
+
+ </assertXPathException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NAMESPACE_ERR.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NAMESPACE_ERR.xml
new file mode 100644
index 0000000..1123424
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NAMESPACE_ERR.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_NAMESPACE_ERR">
+ <metadata>
+ <title>XPathEvaluator_evaluate_NAMESPACE_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ Test if XPathEvaluator.evaluate properly throws NAMESPACE_ERROR
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ </metadata>
+
+ &vars;
+
+ <var name="root" type='Element'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc'
+ var='root'/>
+
+ <assertDOMException id="throw_NAMESPACE_ERR">
+ <NAMESPACE_ERR>
+ <evaluate interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='result'
+ expression='&quot;//foo:bar&quot;'
+ contextNode='root'
+ resolver='nullNSResolver'
+ type='0'
+ result='nullResult'/>
+ </NAMESPACE_ERR>
+
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.xml
new file mode 100644
index 0000000..c2dd8d6
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_NOT_SUPPORTED_ERR">
+ <metadata>
+ <title>XPathEvaluator_evaluate_NOT_SUPPORTED_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ Test if XPathEvaluator.evaluate properly throws NOT_SUPPORTED_ERROR
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ </metadata>
+
+ <var name='doc' type='Document'/>
+ <var name='xpEvaluator' type='XPathEvaluator'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+ <var name="contextNode" type="Node"/>
+
+ <load var='doc' href='staffNS' willBeModified='false'/>
+
+ <createXPathEvaluator var='xpEvaluator' document='doc'/>
+
+ <createEntityReference var="contextNode" obj="doc" name="&quot;entityname&quot;"/>
+
+ <assertDOMException id="throw_NOT_SUPPORTED_ERR">
+ <NOT_SUPPORTED_ERR>
+ <evaluate interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='result'
+ expression='&quot;//foo:bar&quot;'
+ contextNode='contextNode'
+ resolver='nullNSResolver'
+ type='0'
+ result='nullResult'/>
+ </NOT_SUPPORTED_ERR>
+
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.xml
new file mode 100644
index 0000000..152874e
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_TYPE_ERR">
+ <metadata>
+ <title>XPathEvaluator_evaluate_TYPE_ERR</title>
+ <creator>Curt Arnold</creator>
+ <description>
+Evaluate "string(/)" and request that the result be a FIRST_ORDERED_NODE_TYPE, should
+result in a TYPE_ERR.
+ </description>
+ <date qualifier="created">2004-01-10</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=508"/>
+ </metadata>
+ &vars;
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+
+ &findXPathEvaluator;
+
+ <assertXPathException id="throw_TYPE_ERR">
+ <TYPE_ERR>
+ <evaluate interface="XPathEvaluator" obj='xpEvaluator' var='result'
+ expression='"string(/)"' contextNode='doc' resolver='nullNSResolver' type='9' result='nullResult'/>
+ </TYPE_ERR>
+ </assertXPathException>
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR.xml
new file mode 100644
index 0000000..a01a856
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR">
+ <metadata>
+ <title>XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ Test if XPathEvaluator.evaluate properly throws WRONG_DOCUMENT_ERROR
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ </metadata>
+
+ <var name='doc1' type='Document'/>
+ <var name='doc2' type='Document'/>
+ <var name='xpEvaluator' type='XPathEvaluator'/>
+ <var name="root" type='Element'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+
+ <load var='doc1' href='staffNS' willBeModified='false'/>
+ <load var='doc2' href='staff' willBeModified='false'/>
+
+ <createXPathEvaluator var='xpEvaluator' document='doc1'/>
+
+ <documentElement obj='doc2' var='root'/>
+
+ <assertDOMException id="throw_WRONG_DOCUMENT_ERR">
+ <WRONG_DOCUMENT_ERR>
+ <evaluate interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='result'
+ expression='&quot;//foo:bar&quot;'
+ contextNode='root'
+ resolver='nullNSResolver'
+ type='0'
+ result='nullResult'/>
+ </WRONG_DOCUMENT_ERR>
+
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_document.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_document.xml
new file mode 100644
index 0000000..5c053d8
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_document.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_document">
+ <metadata>
+ <title>XPathEvaluator_evaluate_document</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ Retrieve the XPathEvaluator on which the
+ "evaluate("/", document, null, 0, null)" method is invoked with the document
+ element. The method should return an XPathResult.
+ </description>
+ <date qualifier="created">2002-04-28</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ </metadata>
+ &vars;
+ <var name="root" type='Element'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+
+ &findXPathEvaluator;
+
+ <assign value='doc' var='root'/>
+
+ <evaluate interface="XPathEvaluator" obj='xpEvaluator' var='result'
+ expression='&quot;/&quot;' contextNode='root' resolver='nullNSResolver' type='0' result='nullResult'/>
+
+ <assertNotNull actual="result" id="notnull"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_documentElement.xml b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_documentElement.xml
new file mode 100644
index 0000000..ec07e23
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathEvaluator_evaluate_documentElement.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathEvaluator_evaluate_documentElement">
+ <metadata>
+ <title>XPathEvaluator_evaluate_documentElement</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ Retrieve the XPathEvaluator on which the
+ "evaluate("/", documentElement, null, 0, null)" method is invoked with the document
+ element. The method should return an XPathResult.
+ </description>
+ <date qualifier="created">2002-04-28</date>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ </metadata>
+ &vars;
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="root" type='Element'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc' var='root'/>
+
+ <evaluate interface="XPathEvaluator" obj='xpEvaluator' var='result'
+ expression='&quot;/&quot;' contextNode='root' resolver='nullNSResolver' type='0' result='nullResult'/>
+
+ <assertNotNull actual="result" id="notnull"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathExpression_evaluate_NOT_SUPPORTED_ERR.xml b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_NOT_SUPPORTED_ERR.xml
new file mode 100644
index 0000000..6d4af91
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_NOT_SUPPORTED_ERR.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathExpression_evaluate_NOT_SUPPORTED_ERR">
+ <metadata>
+ <title>XPathEvaluator_expression_NOT_SUPPORTED_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ Test if XPathExpression.evaluate properly throws NOT_SUPPORTED_ERROR
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathExpression-evaluate"/>
+ </metadata>
+
+ <var name='doc' type='Document'/>
+ <var name='xpEvaluator' type='XPathEvaluator'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+ <var name="contextNode" type="Node"/>
+ <var name="xpathExpression" type="XPathExpression"/>
+
+ <load var='doc' href='staffNS' willBeModified='false'/>
+
+ <createXPathEvaluator var='xpEvaluator' document='doc'/>
+
+ <createExpression interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='xpathExpression'
+ expression='&quot;//foo&quot;'
+ resolver='nullNSResolver'
+ />
+
+ <createEntityReference var="contextNode" obj="doc" name="&quot;entityname&quot;"/>
+
+ <assertDOMException id="throw_NOT_SUPPORTED_ERR">
+ <NOT_SUPPORTED_ERR>
+ <evaluate interface="XPathExpression"
+ obj='xpathExpression'
+ var='result'
+ contextNode='contextNode'
+ type='0'
+ result='nullResult'/>
+ </NOT_SUPPORTED_ERR>
+
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathExpression_evaluate_WRONG_DOCUMENT_ERR.xml b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_WRONG_DOCUMENT_ERR.xml
new file mode 100644
index 0000000..4b7f790
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_WRONG_DOCUMENT_ERR.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathExpression_evaluate_WRONG_DOCUMENT_ERR">
+ <metadata>
+ <title>XPathExpression_evaluate_WRONG_DOCUMENT_ERR</title>
+ <creator>Philippe Le Hégaret</creator>
+ <contributor>Bob Clary</contributor>
+ <description>
+ Test if XPathExpression.evaluate properly throws WRONG_DOCUMENT_ERROR
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathExpression-evaluate"/>
+ </metadata>
+
+ <var name='doc1' type='Document'/>
+ <var name='doc2' type='Document'/>
+ <var name='xpEvaluator' type='XPathEvaluator'/>
+ <var name="root" type='Element'/>
+ <var name="result" type="XPathResult"/>
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+ <var name="xpathExpression" type="XPathExpression"/>
+
+ <load var='doc1' href='staffNS' willBeModified='false'/>
+ <load var='doc2' href='staff' willBeModified='false'/>
+
+ <createXPathEvaluator var='xpEvaluator' document='doc1'/>
+
+ <createExpression interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='xpathExpression'
+ expression='&quot;//foo&quot;'
+ resolver='nullNSResolver'
+ />
+
+ <documentElement obj='doc2' var='root'/>
+
+ <assertDOMException id="throw_WRONG_DOCUMENT_ERR">
+ <WRONG_DOCUMENT_ERR>
+ <evaluate interface="XPathExpression"
+ obj='xpathExpression'
+ var='result'
+ contextNode='root'
+ type='0'
+ result='nullResult'/>
+ </WRONG_DOCUMENT_ERR>
+
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathExpression_evaluate_document.xml b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_document.xml
new file mode 100644
index 0000000..9892982
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_document.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathExpression_evaluate_document">
+ <metadata>
+ <title>XPathExpression_evaluate_document</title>
+ <creator>Philippe Le Hégaret</creator>
+ <description>
+ Test if XPathExpression.evaluate returns non-null result
+ using Document as contextNode.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathExpression-evaluate"/>
+ </metadata>
+ &vars;
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="contextNode" type='Element'/>
+ <var name="xpathResult" type="XPathResult"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+ <var name="xpathExpression" type="XPathExpression"/>
+ <var name="expression" type="DOMString" value="&quot;/&quot;"/>
+
+ &findXPathEvaluator;
+
+ <assign value='doc' var='contextNode'/>
+
+ <createExpression interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='xpathExpression'
+ expression='expression'
+ resolver='nullNSResolver'
+ />
+
+ <evaluate interface="XPathExpression"
+ obj='xpathExpression'
+ var='xpathResult'
+ contextNode='contextNode'
+ type='0'
+ result='nullResult'/>
+
+ <assertNotNull actual="xpathResult" id="notnull"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathExpression_evaluate_documentElement.xml b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_documentElement.xml
new file mode 100644
index 0000000..f022664
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathExpression_evaluate_documentElement.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathExpression_evaluate_documentElement">
+ <metadata>
+ <title>XPathExpression_evaluate_documentElement</title>
+ <creator>Philippe Le Hégaret</creator>
+ <creator>Bob Clary</creator>
+ <description>
+ Test if XPathExpression.evaluate returns non-null result
+ using Document.documentElement as contextNode.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathExpression-evaluate"/>
+ <subject resource="&spec;#XPathEvaluator-createExpression"/>
+ </metadata>
+
+ &vars;
+
+ <var name="nullNSResolver" type="XPathNSResolver" isNull="true"/>
+ <var name="contextNode" type='Element'/>
+ <var name="xpathResult" type="XPathResult"/>
+ <var name="nullResult" type="XPathResult" isNull="true"/>
+ <var name="xpathExpression" type="XPathExpression"/>
+ <var name="expression" type="DOMString" value="&quot;/&quot;"/>
+
+ &findXPathEvaluator;
+
+ <documentElement obj='doc' var='contextNode'/>
+
+ <createExpression interface="XPathEvaluator"
+ obj='xpEvaluator'
+ var='xpathExpression'
+ expression='expression'
+ resolver='nullNSResolver'
+ />
+
+ <evaluate interface="XPathExpression"
+ obj='xpathExpression'
+ var='xpathResult'
+ contextNode='contextNode'
+ type='0'
+ result='nullResult'/>
+
+ <assertNotNull actual="xpathResult" id="notnull"/>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_nist_dmstc.xml b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_nist_dmstc.xml
new file mode 100644
index 0000000..7467381
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_nist_dmstc.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathNSResolver_lookupNamespaceURI_nist_dmstc">
+ <metadata>
+ <title>XPathNSResolver_lookupNamespaceURI_nist_dmstc</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Interate over all employee elements with xmlns:dmstc attribute
+ in the test document, creating nsresolvers checking that
+ for all children the prefix 'nist' resolves to
+ http://www.nist.gov and that prefix 'dmstc' resolves to the same
+ value as employee.getAttribute('xmlns:dmstc').
+ </description>
+ <date qualifier="created">2003-12-09</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver-lookupNamespaceURI"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+
+ <!-- Test Variables -->
+
+ <var name="lookupNamespaceURI" type="DOMString"/>
+ <var name="namespaceURI" type="DOMString"/>
+ <var name="child" type="Element"/>
+ <var name="children" type="NodeList"/>
+ <var name="employee" type="Element"/>
+ <var name="employees" type="NodeList"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <getElementsByTagNameNS obj="doc"
+ interface="Document"
+ var="employees"
+ namespaceURI="&quot;*&quot;"
+ localName="&quot;employee&quot;"
+ />
+
+ <createXPathEvaluator var='evaluator'
+ document='doc'/>
+
+
+ <for-each member="employee"
+ collection="employees">
+
+
+ <getAttribute obj="employee"
+ interface="Element"
+ name="&quot;xmlns:dmstc&quot;"
+ var="namespaceURI"
+ />
+
+ <getElementsByTagNameNS obj="employee"
+ interface="Element"
+ var="children"
+ namespaceURI="&quot;*&quot;"
+ localName="&quot;*&quot;"
+ />
+
+ <for-each member="child"
+ collection="children">
+
+ <createNSResolver obj="evaluator"
+ var="resolver"
+ nodeResolver="child"
+ />
+
+ <lookupNamespaceURI obj="resolver"
+ interface="XPathNSResolver"
+ var="lookupNamespaceURI"
+ prefix="&quot;dmstc&quot;"
+ />
+
+ <assertEquals id="dmstcequal"
+ actual="lookupNamespaceURI"
+ expected="namespaceURI"
+ ignoreCase="false"
+ />
+
+ <lookupNamespaceURI obj="resolver"
+ interface="XPathNSResolver"
+ var="lookupNamespaceURI"
+ prefix="&quot;nist&quot;"
+ />
+
+ <assertEquals id="nistequal"
+ actual="lookupNamespaceURI"
+ expected="&quot;http://www.nist.gov&quot;"
+ ignoreCase="false"
+ />
+ </for-each>
+
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_null.xml b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_null.xml
new file mode 100644
index 0000000..b628bfa
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_null.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2004 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathNSResolver_lookupNamespaceURI_null">
+ <metadata>
+ <title>XPathNSResolver_lookupNamespaceURI_null</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Iterate over all elements in the test document, creating
+ nsresolvers checking that looking up non-existent prefixes
+ always returns null.
+ </description>
+ <date qualifier="created">2004-12-09</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver-lookupNamespaceURI"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+
+ <!-- Test Variables -->
+
+ <var name="element" type="Element"/>
+ <var name="elements" type="NodeList"/>
+ <var name="lookupNamespaceURI" type="DOMString"/>
+ <var name="namespaceURI" type="DOMString"/>
+ <var name="prefix" type="DOMString"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <!-- Test Body -->
+
+ <getElementsByTagNameNS obj="doc"
+ interface="Document"
+ var="elements"
+ namespaceURI="&quot;*&quot;"
+ localName="&quot;*&quot;"
+ />
+
+ <createXPathEvaluator var='evaluator'
+ document='doc'/>
+
+
+ <for-each member="element"
+ collection="elements">
+
+
+ <createNSResolver obj="evaluator"
+ var="resolver"
+ nodeResolver="element"
+ />
+
+ <lookupNamespaceURI obj="resolver"
+ interface="XPathNSResolver"
+ var="lookupNamespaceURI"
+ prefix="&quot;foobar&quot;"
+ />
+
+ <assertNull id="notnull"
+ actual="lookupNamespaceURI"
+ />
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_prefix.xml b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_prefix.xml
new file mode 100644
index 0000000..e682843
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_prefix.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathNSResolver_lookupNamespaceURI_prefix">
+ <metadata>
+ <title>XPathNSResolver_lookupNamespaceURI_prefix</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Iterate over all Elements in the test document, creating
+ nsresolvers checking that if the Element has a prefix, then
+ lookupNamespaceURI returns the same value as Element.namespaceURI
+ </description>
+ <date qualifier="created">2003-12-09</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver-lookupNamespaceURI"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+
+ <!-- Test Variables -->
+
+ <var name="element" type="Element"/>
+ <var name="elements" type="NodeList"/>
+ <var name="lookupNamespaceURI" type="DOMString"/>
+ <var name="namespaceURI" type="DOMString"/>
+ <var name="prefix" type="DOMString"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <!-- Test Body -->
+
+ <getElementsByTagNameNS obj="doc"
+ interface="Document"
+ var="elements"
+ namespaceURI="&quot;*&quot;"
+ localName="&quot;*&quot;"
+ />
+
+ <createXPathEvaluator var='evaluator'
+ document='doc'/>
+
+
+ <for-each member="element"
+ collection="elements">
+
+ <prefix obj="element"
+ var="prefix"/>
+
+ <if>
+ <notNull obj="prefix"/>
+
+ <createNSResolver obj="evaluator"
+ var="resolver"
+ nodeResolver="element"
+ />
+
+ <namespaceURI obj="element"
+ interface="Node"
+ var="namespaceURI"
+ />
+
+ <lookupNamespaceURI obj="resolver"
+ interface="XPathNSResolver"
+ var="lookupNamespaceURI"
+ prefix="prefix"
+ />
+
+ <assertEquals id="equal"
+ actual="namespaceURI"
+ expected="lookupNamespaceURI"
+ ignoreCase="false"
+ />
+ </if>
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_xml.xml b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_xml.xml
new file mode 100644
index 0000000..a060439
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_xml.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathNSResolver_lookupNamespaceURI_xml">
+ <metadata>
+ <title>XPathNSResolver_lookupNamespaceURI_xml</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Iterate over all elements in the test document, creating
+ nsresolvers checking that looking up the xml prefix returns
+ http://www.w3.org/XML/1998/namespace.
+ </description>
+ <date qualifier="created">2003-12-09</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathNSResolver-lookupNamespaceURI"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+
+ <!-- Test Variables -->
+
+ <var name="element" type="Element"/>
+ <var name="elements" type="NodeList"/>
+ <var name="lookupNamespaceURI" type="DOMString"/>
+ <var name="namespaceURI" type="DOMString"/>
+ <var name="prefix" type="DOMString"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staffNS" willBeModified="false"/>
+
+ <!-- Test Body -->
+
+ <getElementsByTagNameNS obj="doc"
+ interface="Document"
+ var="elements"
+ namespaceURI="&quot;*&quot;"
+ localName="&quot;*&quot;"
+ />
+
+ <createXPathEvaluator var='evaluator'
+ document='doc'/>
+
+
+ <for-each member="element"
+ collection="elements">
+
+
+ <createNSResolver obj="evaluator"
+ var="resolver"
+ nodeResolver="element"
+ />
+
+ <lookupNamespaceURI obj="resolver"
+ interface="XPathNSResolver"
+ var="lookupNamespaceURI"
+ prefix="&quot;xml&quot;"
+ />
+
+ <assertEquals id="equal"
+ actual="lookupNamespaceURI"
+ expected="&quot;http://www.w3.org/XML/1998/namespace&quot;"
+ ignoreCase="false"
+ />
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_TYPE_ERR.xml b/test/testcases/tests/level3/xpath/XPathResult_TYPE_ERR.xml
new file mode 100644
index 0000000..29cae68
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_TYPE_ERR.xml
@@ -0,0 +1,457 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_TYPE_ERR">
+ <metadata>
+ <title>XPathResult_TYPE_ERR</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult for the expression /staff/employee
+ for each type of XPathResultType, checking that TYPE_ERR
+ is thrown when inappropriate properties and methods are accessed.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#TYPE_ERR"/>
+ <subject resource="&spec;#XPathException"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathResult-resultType"/>
+ <subject resource="&spec;#XPathResult-booleanValue"/>
+ <subject resource="&spec;#XPathResult-numberValue"/>
+ <subject resource="&spec;#XPathResult-singleNodeValue"/>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-stringValue"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="evaluator" type="XPathEvaluator"/>
+ <var name="expression" type="DOMString"
+ value="&quot;/staff/employee&quot;"/>
+ <var name="contextNode" type="Node"/>
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+ <var name="inNodeType" type="short"/>
+ <var name="outNodeType" type="short"/>
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="booleanValue" type="boolean"/>
+ <var name="shortValue" type="short"/>
+ <var name="intValue" type="int"/>
+ <var name="doubleValue" type="double"/>
+ <var name="nodeValue" type="Node"/>
+ <var name="stringValue" type="DOMString"/>
+
+ <var name="nodeTypeList" type="List">
+ <member type="short">0</member>
+ <member type="short">1</member>
+ <member type="short">2</member>
+ <member type="short">3</member>
+ <member type="short">4</member>
+ <member type="short">5</member>
+ <member type="short">6</member>
+ <member type="short">7</member>
+ <member type="short">8</member>
+ <member type="short">9</member>
+ </var>
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <for-each collection="nodeTypeList" member="inNodeType">
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="inNodeType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <resultType obj="outresult"
+ var="outNodeType"/>
+
+ <if>
+ <equals expected="outNodeType" actual="NUMBER_TYPE"/>
+ <assertXPathException id="number_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="number_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="number_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="number_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="number_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="number_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="STRING_TYPE"/>
+ <assertXPathException id="string_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="string_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="string_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="string_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="string_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="string_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="BOOLEAN_TYPE"/>
+ <assertXPathException id="boolean_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="boolean_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="boolean_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="boolean_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="boolean_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="boolean_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="UNORDERED_NODE_ITERATOR_TYPE"/>
+ <assertXPathException id="unordered_node_iterator_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_iterator_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_iterator_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_iterator_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_iterator_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_iterator_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="ORDERED_NODE_ITERATOR_TYPE"/>
+ <assertXPathException id="ordered_node_iterator_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_iterator_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_iterator_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_iterator_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_iterator_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_iterator_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="UNORDERED_NODE_SNAPSHOT_TYPE"/>
+ <assertXPathException id="unordered_node_snapshot_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_snapshot_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_snapshot_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_snapshot_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="unordered_node_snapshot_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="ORDERED_NODE_SNAPSHOT_TYPE"/>
+ <assertXPathException id="ordered_node_snapshot_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_snapshot_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_snapshot_singleNodeValue_TYPE_ERR">
+ <TYPE_ERR>
+ <singleNodeValue obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_snapshot_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="ordered_node_snapshot_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="ANY_UNORDERED_NODE_TYPE"/>
+ <assertXPathException id="any_unordered_node_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="any_unordered_node_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="any_unordered_node_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="any_unordered_node_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="any_unordered_node_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="any_unordered_node_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+ <if>
+ <equals expected="outNodeType" actual="FIRST_ORDERED_NODE_TYPE"/>
+ <assertXPathException id="first_ordered_node_booleanValue_TYPE_ERR">
+ <TYPE_ERR>
+ <booleanValue obj="outresult"
+ var="booleanValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="first_ordered_node_numberValue_TYPE_ERR">
+ <TYPE_ERR>
+ <numberValue obj="outresult"
+ var="doubleValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="first_ordered_node_snapshotLength_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotLength obj="outresult"
+ var="intValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="first_ordered_node_stringValue_TYPE_ERR">
+ <TYPE_ERR>
+ <stringValue obj="outresult"
+ var="stringValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="first_ordered_node_iterateNext_TYPE_ERR">
+ <TYPE_ERR>
+ <iterateNext obj="outresult"
+ var="nodeValue"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ <assertXPathException id="first_ordered_node_snapshotItem_TYPE_ERR">
+ <TYPE_ERR>
+ <snapshotItem obj="outresult"
+ var="nodeValue"
+ index="0"/>
+ </TYPE_ERR>
+ </assertXPathException>
+ </if>
+
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_booleanValue_false.xml b/test/testcases/tests/level3/xpath/XPathResult_booleanValue_false.xml
new file mode 100644
index 0000000..bb513f0
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_booleanValue_false.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_booleanValue_false">
+ <metadata>
+ <title>XPathResult_booleanValue_false</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create BOOLEAN_TYPE XPathResult matching /staff/workerbee,
+ checking that XPathResult.booleanValue == false
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-booleanValue"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/workerbee&quot;"/>
+ <var name="xpathType" type="short" value="BOOLEAN_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+ <var name="parent" type="Node"/>
+ <var name="owner" type="Node"/>
+ <var name="ownerType" type="int"/>
+ <var name="booleanValue" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <booleanValue obj="outresult"
+ var="booleanValue"
+ />
+
+ <assertFalse id="false"
+ actual="booleanValue"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_booleanValue_true.xml b/test/testcases/tests/level3/xpath/XPathResult_booleanValue_true.xml
new file mode 100644
index 0000000..ad52246
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_booleanValue_true.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_booleanValue_true">
+ <metadata>
+ <title>XPathResult_booleanValue_true</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create BOOLEAN_TYPE XPathResult matching /staff/employee,
+ checking that XPathResult.booleanValue == true
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-booleanValue"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="BOOLEAN_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+ <var name="parent" type="Node"/>
+ <var name="owner" type="Node"/>
+ <var name="ownerType" type="int"/>
+ <var name="booleanValue" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <booleanValue obj="outresult"
+ var="booleanValue"
+ />
+
+ <assertTrue id="true"
+ actual="booleanValue"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_TYPE.xml
new file mode 100644
index 0000000..5a19d48
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_ANY_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_ANY_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a ANY_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are invalidated XPathResult.invalidIteratorState == true.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertTrue id="true"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE.xml
new file mode 100644
index 0000000..83ad159
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a ANY_UNORDERED_NODE_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="ANY_UNORDERED_NODE_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_BOOLEAN_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_BOOLEAN_TYPE.xml
new file mode 100644
index 0000000..09679ed
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_BOOLEAN_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_BOOLEAN_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_BOOLEAN_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a BOOLEAN_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="BOOLEAN_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE.xml
new file mode 100644
index 0000000..99931f4
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a FIRST_ORDERED_NODE_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="FIRST_ORDERED_NODE_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_NUMBER_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_NUMBER_TYPE.xml
new file mode 100644
index 0000000..f845eb3
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_NUMBER_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_NUMBER_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_NUMBER_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a NUMBER_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="NUMBER_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.xml
new file mode 100644
index 0000000..9da142c
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a ORDERED_NODE_ITERATOR_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are invalidated XPathResult.invalidIteratorState == true.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="ORDERED_NODE_ITERATOR_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertTrue id="true"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE.xml
new file mode 100644
index 0000000..ed41282
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a ORDERED_NODE_SNAPSHOT_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="ORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_STRING_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_STRING_TYPE.xml
new file mode 100644
index 0000000..5348d82
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_STRING_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_STRING_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_STRING_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a STRING_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="STRING_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.xml
new file mode 100644
index 0000000..92c0a36
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a UNORDERED_NODE_ITERATOR_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are invalidated XPathResult.invalidIteratorState == true.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="UNORDERED_NODE_ITERATOR_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertTrue id="true"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE.xml
new file mode 100644
index 0000000..f4c02d5
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE">
+ <metadata>
+ <title>XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a UNORDERED_NODE_SNAPSHOT_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that iterator XPathResults
+ are not invalidated XPathResult.invalidIteratorState == false.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult-invalid-iterator-state"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="UNORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+ <var name="invalidIteratorState" type="boolean"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <invalidIteratorState obj="outresult"
+ var="invalidIteratorState"
+ />
+
+ <assertFalse id="false"
+ actual="invalidIteratorState"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_iterateNext_INVALID_STATE_ERR.xml b/test/testcases/tests/level3/xpath/XPathResult_iterateNext_INVALID_STATE_ERR.xml
new file mode 100644
index 0000000..cfec132
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_iterateNext_INVALID_STATE_ERR.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_iterateNext_INVALID_STATE_ERR">
+ <metadata>
+ <title>XPathResult_iterateNext_INVALID_STATE_ERR</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create a ANY_TYPE XPathResult matching /staff/employee,
+ modify the Document, then check that XPathResults.iterateNext
+ throws DOMException INVALID_STATE_ERR.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathEvaluator"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathNSResolver"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResult-iterateNext"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="xpathType" type="short" value="ANY_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+ <var name="parent" type="Node"/>
+ <var name="owner" type="Node"/>
+ <var name="ownerType" type="int"/>
+ <var name="employee" type="Node"/>
+ <var name="docElement" type="Node"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="true"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <!-- Test Body -->
+
+ <documentElement obj="doc"
+ var="docElement"/>
+
+ <createElement obj="doc"
+ var="employee"
+ tagName="&quot;employee&quot;"/>
+
+ <appendChild obj="docElement"
+ newChild="employee"
+ var="employee"/>
+
+ <assertDOMException id="throw_INVALID_STATE_ERR">
+ <INVALID_STATE_ERR>
+ <iterateNext var="outNode" obj="outresult"/>
+ </INVALID_STATE_ERR>
+ </assertDOMException>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE.xml
new file mode 100644
index 0000000..3a41bfd
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE">
+ <metadata>
+ <title>XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult ORDERED_NODE_ITERATOR_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.iteratorNext returns the nodes in document order,
+ and that the correct number is returned.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-iteratorNext"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="ORDERED_NODE_ITERATOR_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="index" type="int"/>
+ <var name="text" type="DOMString" />
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <assign var="index"
+ value="0"
+ />
+
+ <iterateNext var="outNode" obj="outresult"/>
+ <while>
+ <notNull obj="outNode"/>
+
+ <data obj="outNode"
+ interface="CharacterData"
+ var="text"
+ />
+
+ <if><equals actual="index" expected="0" />
+
+ <assertEquals id="first"
+ actual="text"
+ expected="&quot;EMP0001&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="1" />
+
+ <assertEquals id="second"
+ actual="text"
+ expected="&quot;EMP0002&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="2" />
+
+ <assertEquals id="third"
+ actual="text"
+ expected="&quot;EMP0003&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="3" />
+
+ <assertEquals id="fourth"
+ actual="text"
+ expected="&quot;EMP0004&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="4" />
+
+ <assertEquals id="fifth"
+ actual="text"
+ expected="&quot;EMP0005&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <increment var="index"
+ value="1"
+ />
+
+ <iterateNext var="outNode" obj="outresult"/>
+
+ </while>
+
+ <assertEquals id="count"
+ actual="index"
+ expected="5"
+ ignoreCase="false"
+ />
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE.xml
new file mode 100644
index 0000000..ff0629b
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE">
+ <metadata>
+ <title>XPathResult_iteratorNext_UNORDERED_NODE_ITERATOR_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult UNORDERED_NODE_ITERATOR_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.iteratorNext contains the correct number of nodes.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-iteratorNext"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="UNORDERED_NODE_ITERATOR_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="nodeType" type="int"/>
+ <var name="parent" type="Node"/>
+ <var name="owner" type="Node"/>
+ <var name="ownerType" type="int"/>
+ <var name="index" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <assign var="index"
+ value="0"
+ />
+
+ <iterateNext var="outNode" obj="outresult"/>
+ <while>
+ <notNull obj="outNode"/>
+
+ <increment var="index"
+ value="1"
+ />
+
+ <iterateNext var="outNode" obj="outresult"/>
+
+ </while>
+
+ <assertEquals id="count"
+ actual="index"
+ expected="4"
+ ignoreCase="false"
+ />
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_numberValue.xml b/test/testcases/tests/level3/xpath/XPathResult_numberValue.xml
new file mode 100644
index 0000000..dd6a2ee
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_numberValue.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_numberValue">
+ <metadata>
+ <title>XPathResult_numberValue</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult NUMBER_VALUE XPathResultType for expression
+ /staff/employee/salary[text() = '56,000'] checking that the
+ XPathResult.numberValue == 56.0
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-numberValue"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;substring-before(/staff/employee/salary[text() = '56,000'], ',')&quot;"/>
+ <var name="xpathType" type="short" value="NUMBER_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="numberValue" type="double"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <numberValue obj="outresult"
+ var="numberValue"
+ />
+
+ <assertEquals id="same"
+ actual="numberValue"
+ expected="56.0"
+ ignoreCase="false"
+ />
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_resultType.xml b/test/testcases/tests/level3/xpath/XPathResult_resultType.xml
new file mode 100644
index 0000000..05b4414
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_resultType.xml
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_resultType">
+ <metadata>
+ <title>XPathResult_resultType</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult for the expression /staff/employee
+ for each type of XPathResultType, checking that the resultType
+ of the XPathResult matches the requested type.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ <subject resource="&spec;#XPathEvaluator-evaluate"/>
+ <subject resource="&spec;#XPathResult-resultType"/>
+ <subject resource="&spec;#XPathException"/>
+
+ </metadata>
+
+ <var name="doc" type="Document"/>
+ <var name="resolver" type="XPathNSResolver"/>
+ <var name="evaluator" type="XPathEvaluator"/>
+ <var name="expression" type="DOMString" value="&quot;/staff/employee&quot;"/>
+ <var name="contextNode" type="Node"/>
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+ <var name="inNodeType" type="short"/>
+ <var name="outNodeType" type="short"/>
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+ <var name="isTypeEqual" type="boolean"/>
+
+ <var name="nodeTypeList" type="List">
+ <member type="short">0</member>
+ <member type="short">1</member>
+ <member type="short">2</member>
+ <member type="short">3</member>
+ <member type="short">4</member>
+ <member type="short">5</member>
+ <member type="short">6</member>
+ <member type="short">7</member>
+ <member type="short">8</member>
+ <member type="short">9</member>
+ </var>
+
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <for-each collection="nodeTypeList" member="inNodeType">
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="inNodeType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <resultType obj="outresult"
+ var="outNodeType"/>
+
+ <if>
+ <equals expected="inNodeType" actual="ANY_TYPE"/>
+ <assertEquals id="ANY_TYPE_resulttype"
+ actual="outNodeType"
+ expected="UNORDERED_NODE_ITERATOR_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="NUMBER_TYPE"/>
+ <assertEquals id="NUMBER_TYPE_resulttype"
+ actual="outNodeType"
+ expected="NUMBER_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="STRING_TYPE"/>
+ <assertEquals id="STRING_TYPE_resulttype"
+ actual="outNodeType"
+ expected="STRING_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="BOOLEAN_TYPE"/>
+ <assertEquals id="BOOLEAN_TYPE_resulttype"
+ actual="outNodeType"
+ expected="BOOLEAN_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="UNORDERED_NODE_ITERATOR_TYPE"/>
+ <assertEquals id="UNORDERED_NODE_ITERATOR_TYPE_resulttype"
+ actual="outNodeType"
+ expected="UNORDERED_NODE_ITERATOR_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="ORDERED_NODE_ITERATOR_TYPE"/>
+ <assertEquals id="ORDERED_NODE_ITERATOR_TYPE_resulttype"
+ actual="outNodeType"
+ expected="ORDERED_NODE_ITERATOR_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="UNORDERED_NODE_SNAPSHOT_TYPE"/>
+ <assertEquals id="UNORDERED_NODE_SNAPSHOT_TYPE_resulttype"
+ actual="outNodeType"
+ expected="UNORDERED_NODE_SNAPSHOT_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="ORDERED_NODE_SNAPSHOT_TYPE"/>
+ <assertEquals id="ORDERED_NODE_SNAPSHOT_TYPE_resulttype"
+ actual="outNodeType"
+ expected="ORDERED_NODE_SNAPSHOT_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="ANY_UNORDERED_NODE_TYPE"/>
+ <assertEquals id="ANY_UNORDERED_NODE_TYPE_resulttype"
+ actual="outNodeType"
+ expected="ANY_UNORDERED_NODE_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+ <if>
+ <equals expected="inNodeType" actual="FIRST_ORDERED_NODE_TYPE"/>
+ <assertEquals id="FIRST_ORDERED_NODE_TYPE_resulttype"
+ actual="outNodeType"
+ expected="FIRST_ORDERED_NODE_TYPE"
+ ignoreCase="false"
+ />
+ </if>
+
+ </for-each>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE.xml
new file mode 100644
index 0000000..dacbe43
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE">
+ <metadata>
+ <title>XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create ANY_UNORDERED_NODE_TYPE XPathResult matching /staff/employee/employeeId,
+ checking that XPathResult.singleNodeValue matches.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId&quot;"/>
+ <var name="xpathType" type="short" value="ANY_UNORDERED_NODE_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="employeeId" type="Node"/>
+ <var name="localName" type="DOMString"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <singleNodeValue obj="outresult"
+ var="outNode"
+ />
+
+ <localName obj="outNode"
+ var="localName"
+ />
+
+ <assertEquals id="equals"
+ actual="localName"
+ expected="&quot;employeeId&quot;"
+ ignoreCase="false"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE.xml
new file mode 100644
index 0000000..67e497e
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE">
+ <metadata>
+ <title>XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create FIRST_ORDERED_NODE_TYPE XPathResult matching /staff/employee/employeeId/text(),
+ checking that XPathResult.singleNodeValue matches the first EMP0001.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="FIRST_ORDERED_NODE_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="outNode" type="Node"/>
+ <var name="data" type="DOMString"/>
+ <var name="nodeName" type="DOMString"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <singleNodeValue obj="outresult"
+ var="outNode"
+ />
+
+ <data obj="outNode"
+ interface="CharacterData"
+ var="data"
+ />
+
+ <assertEquals id="equals"
+ actual="data"
+ expected="&quot;EMP0001&quot;"
+ ignoreCase="false"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null.xml b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null.xml
new file mode 100644
index 0000000..a7f6daa
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null">
+ <metadata>
+ <title>XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult ORDERED_NODE_SNAPSHOT_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.snapshotItem(xPathResult.snapshotLength) == null,
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="ORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="snapshotItem" type="Node"/>
+ <var name="snapshotLength" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <snapshotLength obj="outresult"
+ var="snapshotLength"
+ />
+
+ <snapshotItem obj="outresult"
+ var="snapshotItem"
+ index="snapshotLength"
+ />
+
+ <assertNull id="null"
+ actual="snapshotItem"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order.xml b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order.xml
new file mode 100644
index 0000000..63bdb69
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order">
+ <metadata>
+ <title>XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult ORDERED_NODE_SNAPSHOT_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.snapshotItem(0..3) are in document order.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="ORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="snapshotItem" type="Node"/>
+ <var name="snapshotLength" type="int"/>
+ <var name="index" type="int"/>
+ <var name="text" type="DOMString" />
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <assign var="index"
+ value="0"
+ />
+
+ <while>
+ <less actual="index"
+ expected="4"
+ />
+
+ <snapshotItem obj="outresult"
+ var="snapshotItem"
+ index="index"
+ />
+
+ <data obj="snapshotItem"
+ interface="CharacterData"
+ var="text"
+ />
+
+ <if><equals actual="index" expected="0" />
+
+ <assertEquals id="first"
+ actual="text"
+ expected="&quot;EMP0001&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="1" />
+
+ <assertEquals id="second"
+ actual="text"
+ expected="&quot;EMP0002&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="2" />
+
+ <assertEquals id="third"
+ actual="text"
+ expected="&quot;EMP0003&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <if><equals actual="index" expected="3" />
+
+ <assertEquals id="fourth"
+ actual="text"
+ expected="&quot;EMP0004&quot;"
+ ignoreCase="false"
+ />
+ </if>
+
+ <increment var="index"
+ value="1"
+ />
+
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count.xml b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count.xml
new file mode 100644
index 0000000..6d3b708
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count">
+ <metadata>
+ <title>XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult UNORDERED_NODE_SNAPSHOT_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.snapshotItem(0..3) exist.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="UNORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="snapshotItem" type="Node"/>
+ <var name="snapshotLength" type="int"/>
+ <var name="index" type="int"/>
+ <var name="text" type="DOMString" />
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <assign var="index"
+ value="0"
+ />
+
+ <while>
+ <less actual="index"
+ expected="5"
+ />
+
+ <snapshotItem obj="outresult"
+ var="snapshotItem"
+ index="index"
+ />
+
+ <assertNotNull id="notnull"
+ actual="snapshotItem"
+ />
+
+ <increment var="index"
+ value="1"
+ />
+
+ </while>
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null.xml b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null.xml
new file mode 100644
index 0000000..b10271f
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null">
+ <metadata>
+ <title>XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult UNORDERED_NODE_SNAPSHOT_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.snapshotItem(xPathResult.snapshotLength) == null,
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="UNORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="snapshotItem" type="Node"/>
+ <var name="snapshotLength" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <snapshotLength obj="outresult"
+ var="snapshotLength"
+ />
+
+ <snapshotItem obj="outresult"
+ var="snapshotItem"
+ index="snapshotLength"
+ />
+
+ <assertNull id="null"
+ actual="snapshotItem"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE.xml
new file mode 100644
index 0000000..2e7774c
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE">
+ <metadata>
+ <title>XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult ORDERED_NODE_SNAPSHOT_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.snapshotLength is correct value.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="ORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="snapshotItem" type="Node"/>
+ <var name="snapshotLength" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <snapshotLength obj="outresult"
+ var="snapshotLength"
+ />
+
+ <assertEquals id="same"
+ actual="snapshotLength"
+ expected="5"
+ ignoreCase="false"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE.xml b/test/testcases/tests/level3/xpath/XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE.xml
new file mode 100644
index 0000000..5146a4f
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE">
+ <metadata>
+ <title>XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult UNORDERED_NODE_SNAPSHOT_TYPE XPathResultType for
+ expression /staff/employee/employeeId/text() checking that:
+ XPathResult.snapshotLength is correct value.
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-snapshot-length"/>
+ <subject resource="&spec;#XPathResult-snapshotItem"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/employeeId/text()&quot;"/>
+ <var name="xpathType" type="short" value="UNORDERED_NODE_SNAPSHOT_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="snapshotItem" type="Node"/>
+ <var name="snapshotLength" type="int"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <snapshotLength obj="outresult"
+ var="snapshotLength"
+ />
+
+ <assertEquals id="same"
+ actual="snapshotLength"
+ expected="5"
+ ignoreCase="false"
+ />
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/XPathResult_stringValue.xml b/test/testcases/tests/level3/xpath/XPathResult_stringValue.xml
new file mode 100644
index 0000000..bc68069
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/XPathResult_stringValue.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE test SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<test xmlns="&level3;" name="XPathResult_stringValue">
+ <metadata>
+ <title>XPathResult_stringValue</title>
+ <creator>Bob Clary</creator>
+ <description>
+ Create an XPathResult STRING_VALUE XPathResultType for expression
+ /staff/employee/salary[text()='56,000'] checking that the
+ XPathResult.stringValue == "56,000"
+ </description>
+ <date qualifier="created">2003-12-02</date>
+ <subject resource="&spec;#XPathResult-stringValue"/>
+ <subject resource="&spec;#XPathResult"/>
+ <subject resource="&spec;#XPathResultType"/>
+ <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
+ </metadata>
+
+ <!-- Standard Variables -->
+
+ <var name="ANY_TYPE" type="short" value="0"/>
+ <var name="NUMBER_TYPE" type="short" value="1"/>
+ <var name="STRING_TYPE" type="short" value="2"/>
+ <var name="BOOLEAN_TYPE" type="short" value="3"/>
+ <var name="UNORDERED_NODE_ITERATOR_TYPE" type="short" value="4"/>
+ <var name="ORDERED_NODE_ITERATOR_TYPE" type="short" value="5"/>
+ <var name="UNORDERED_NODE_SNAPSHOT_TYPE" type="short" value="6"/>
+ <var name="ORDERED_NODE_SNAPSHOT_TYPE" type="short" value="7"/>
+ <var name="ANY_UNORDERED_NODE_TYPE" type="short" value="8"/>
+ <var name="FIRST_ORDERED_NODE_TYPE" type="short" value="9"/>
+
+ <var name="doc" type="Document" />
+ <var name="resolver" type="XPathNSResolver" />
+ <var name="evaluator" type="XPathEvaluator" />
+ <var name="contextNode" type="Node" />
+ <var name="inresult" type="XPathResult" isNull="true"/>
+ <var name="outresult" type="XPathResult" isNull="true"/>
+
+ <!-- Inputs -->
+
+ <var name="expression" type="DOMString" value="&quot;/staff/employee/salary[text()='56,000']&quot;"/>
+ <var name="xpathType" type="short" value="STRING_TYPE" />
+
+ <!-- Test Variables -->
+
+ <var name="stringValue" type="DOMString"/>
+
+ <!-- Load Test Document -->
+
+ <load var="doc" href="staff" willBeModified="false"/>
+
+ <!-- Get XPathResult -->
+
+ <createXPathEvaluator var="evaluator" document="doc"/>
+
+ <createNSResolver obj="evaluator" var="resolver" nodeResolver="doc"/>
+
+ <assign var="contextNode" value="doc"/>
+
+ <evaluate obj="evaluator"
+ var="outresult"
+ expression="expression"
+ contextNode="contextNode"
+ resolver="resolver"
+ type="xpathType"
+ result="inresult"
+ interface="XPathEvaluator"
+ />
+
+ <stringValue obj="outresult"
+ var="stringValue"
+ />
+
+ <assertEquals id="same"
+ actual="stringValue"
+ expected="&quot;56,000&quot;"
+ ignoreCase="false"
+ />
+
+
+</test>
diff --git a/test/testcases/tests/level3/xpath/alltests.xml b/test/testcases/tests/level3/xpath/alltests.xml
new file mode 100644
index 0000000..b5187c6
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/alltests.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE suite SYSTEM "dom3.dtd" [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<suite xmlns="&level3;" name="alltests">
+ <metadata>
+ <title>DOM Level 3 XPath Test Suite</title>
+ <creator>DOM Test Suite Project</creator>
+ </metadata>
+ <suite.member href="XPathEvaluatorCast01.xml"/>
+ <suite.member href="Element_Nodes.xml"/>
+ <suite.member href="Attribute_Nodes.xml"/>
+ <suite.member href="Attribute_Nodes_xmlns.xml"/>
+ <suite.member href="Text_Nodes.xml"/>
+ <suite.member href="Comment_Nodes.xml"/>
+ <suite.member href="Processing_Instruction_Nodes.xml"/>
+ <suite.member href="Conformance_Expressions.xml"/>
+ <suite.member href="Conformance_hasFeature_3.xml"/>
+ <suite.member href="Conformance_hasFeature_empty.xml"/>
+ <suite.member href="Conformance_hasFeature_null.xml"/>
+ <suite.member href="Conformance_ID.xml"/>
+ <suite.member href="Conformance_isSupported_3.xml"/>
+ <suite.member href="Conformance_isSupported_empty.xml"/>
+ <suite.member href="Conformance_isSupported_null.xml"/>
+ <suite.member href="XPathEvaluator_createExpression_no_NS.xml"/>
+ <suite.member href="XPathEvaluator_createExpression_NS.xml"/>
+ <suite.member href="XPathEvaluator_createExpression_NAMESPACE_ERR_01.xml"/>
+ <suite.member href="XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.xml"/>
+ <suite.member href="XPathEvaluator_createExpression_NAMESPACE_ERR_02.xml"/>
+ <suite.member href="XPathEvaluator_createNSResolver_document.xml"/>
+ <suite.member href="XPathEvaluator_createNSResolver_documentElement.xml"/>
+ <suite.member href="XPathEvaluator_createNSResolver_all.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_documentElement.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_document.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_NAMESPACE_ERR.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_WRONG_DOCUMENT_ERR.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.xml"/>
+ <suite.member href="XPathEvaluator_evaluate_TYPE_ERR.xml"/>
+ <suite.member href="XPathExpression_evaluate_documentElement.xml"/>
+ <suite.member href="XPathExpression_evaluate_document.xml"/>
+ <suite.member href="XPathExpression_evaluate_WRONG_DOCUMENT_ERR.xml"/>
+ <suite.member href="XPathExpression_evaluate_NOT_SUPPORTED_ERR.xml"/>
+ <suite.member href="XPathNSResolver_lookupNamespaceURI_prefix.xml"/>
+ <suite.member href="XPathNSResolver_lookupNamespaceURI_nist_dmstc.xml"/>
+ <suite.member href="XPathNSResolver_lookupNamespaceURI_xml.xml"/>
+ <suite.member href="XPathNSResolver_lookupNamespaceURI_null.xml"/>
+ <suite.member href="XPathResult_booleanValue_true.xml"/>
+ <suite.member href="XPathResult_booleanValue_false.xml"/>
+ <suite.member href="XPathResult_iterateNext_INVALID_STATE_ERR.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_ANY_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_ANY_UNORDERED_NODE_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_BOOLEAN_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_FIRST_ORDERED_NODE_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_NUMBER_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_ORDERED_NODE_SNAPSHOT_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_STRING_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.xml"/>
+ <suite.member href="XPathResult_invalidIteratorState_UNORDERED_NODE_SNAPSHOT_TYPE.xml"/>
+ <suite.member href="XPathResult_iteratorNext_ORDERED_NODE_ITERATOR_TYPE.xml"/>
+ <suite.member href="XPathResult_numberValue.xml"/>
+ <suite.member href="XPathResult_resultType.xml"/>
+ <suite.member href="XPathResult_singleNodeValue_ANY_UNORDERED_NODE_TYPE.xml"/>
+ <suite.member href="XPathResult_singleNodeValue_FIRST_ORDERED_NODE_TYPE.xml"/>
+ <suite.member href="XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_null.xml"/>
+ <suite.member href="XPathResult_snapshotItem_ORDERED_NODE_SNAPSHOT_TYPE_order.xml"/>
+ <suite.member href="XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_null.xml"/>
+ <suite.member href="XPathResult_snapshotItem_UNORDERED_NODE_SNAPSHOT_TYPE_count.xml"/>
+ <suite.member href="XPathResult_snapshotLength_ORDERED_NODE_SNAPSHOT_TYPE.xml"/>
+ <suite.member href="XPathResult_snapshotLength_UNORDERED_NODE_SNAPSHOT_TYPE.xml"/>
+ <suite.member href="XPathResult_stringValue.xml"/>
+ <suite.member href="XPathResult_TYPE_ERR.xml"/>
+</suite>
+
diff --git a/test/testcases/tests/level3/xpath/dom3xpathents.ent b/test/testcases/tests/level3/xpath/dom3xpathents.ent
new file mode 100644
index 0000000..8dd1053
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/dom3xpathents.ent
@@ -0,0 +1,16 @@
+<!ENTITY level3 "http://www.w3.org/2001/DOM-Test-Suite/Level-3">
+<!ENTITY spec "http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath">
+
+<!ENTITY vars
+ "
+ <!-- common variables -->
+ <var name='doc' type='Document'/>
+ <var name='xpEvaluator' type='XPathEvaluator'/>
+ ">
+
+<!-- the following entity requires the entity vars as well -->
+<!ENTITY findXPathEvaluator
+ "
+ <load var='doc' href='staffNS' willBeModified='false'/>
+ <createXPathEvaluator var='xpEvaluator' document='doc'/>
+">
diff --git a/test/testcases/tests/level3/xpath/files/CVS/Entries b/test/testcases/tests/level3/xpath/files/CVS/Entries
new file mode 100644
index 0000000..6a27afe
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/CVS/Entries
@@ -0,0 +1,11 @@
+/internaldtd.svg/1.2/Fri Apr 3 02:47:58 2009/-kb/
+/internaldtd.xml/1.1/Fri Apr 3 02:47:58 2009//
+/staff.dtd/1.1/Fri Apr 3 02:47:58 2009//
+/staff.svg/1.1/Fri Apr 3 02:47:58 2009/-kb/
+/staff.xml/1.1/Fri Apr 3 02:47:58 2009//
+/staffNS.dtd/1.1/Fri Apr 3 02:47:58 2009//
+/staffNS.svg/1.1/Fri Apr 3 02:47:58 2009/-kb/
+/staffNS.xml/1.1/Fri Apr 3 02:47:58 2009//
+/svgtest.js/1.1/Fri Apr 3 02:47:58 2009/-kb/
+/svgunit.js/1.1/Fri Apr 3 02:47:58 2009/-kb/
+D
diff --git a/test/testcases/tests/level3/xpath/files/CVS/Repository b/test/testcases/tests/level3/xpath/files/CVS/Repository
new file mode 100644
index 0000000..b343eb6
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/CVS/Repository
@@ -0,0 +1 @@
+2001/DOM-Test-Suite/tests/level3/xpath/files
diff --git a/test/testcases/tests/level3/xpath/files/CVS/Root b/test/testcases/tests/level3/xpath/files/CVS/Root
new file mode 100644
index 0000000..3c7177e
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@dev.w3.org:/sources/public
diff --git a/test/testcases/tests/level3/xpath/files/CVS/Template b/test/testcases/tests/level3/xpath/files/CVS/Template
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/CVS/Template
diff --git a/test/testcases/tests/level3/xpath/files/internaldtd.svg b/test/testcases/tests/level3/xpath/files/internaldtd.svg
new file mode 100644
index 0000000..2464ef1
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/internaldtd.svg
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg [
+ <!ELEMENT test (child)+ >
+ <!ATTLIST test xmlns CDATA #IMPLIED>
+ <!ELEMENT child EMPTY>
+ <!ATTLIST child id ID #IMPLIED>
+ <!ATTLIST child check CDATA #IMPLIED>
+ <!ELEMENT svg (rect, script, test)>
+ <!ATTLIST svg
+ xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
+ name CDATA #IMPLIED>
+ <!ELEMENT rect EMPTY>
+ <!ATTLIST rect
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ width CDATA #REQUIRED
+ height CDATA #REQUIRED>
+ <!ELEMENT script (#PCDATA)>
+ <!ATTLIST script type CDATA #IMPLIED>
+ <!ENTITY svgunit SYSTEM "svgunit.js">
+ <!ENTITY svgtest SYSTEM "svgtest.js">
+]>
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script>
+<test xmlns="http://www.example.org">
+ <child id="child1" check="child1"/>
+ <child id="child2" check="child2"/>
+</test>
+</svg>
+
diff --git a/test/testcases/tests/level3/xpath/files/internaldtd.xml b/test/testcases/tests/level3/xpath/files/internaldtd.xml
new file mode 100644
index 0000000..0844f5c
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/internaldtd.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE test [
+ <!ELEMENT test (child)+ >
+ <!ELEMENT child EMPTY>
+ <!ATTLIST child id ID #IMPLIED>
+ <!ATTLIST child check CDATA #IMPLIED>
+]>
+<test>
+ <child id="child1" check="child1"/>
+ <child id="child2" check="child2"/>
+</test>
+
diff --git a/test/testcases/tests/level3/xpath/files/staff.dtd b/test/testcases/tests/level3/xpath/files/staff.dtd
new file mode 100644
index 0000000..02a994d
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/staff.dtd
@@ -0,0 +1,17 @@
+<!ELEMENT employeeId (#PCDATA)>
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT position (#PCDATA)>
+<!ELEMENT salary (#PCDATA)>
+<!ELEMENT address (#PCDATA)>
+<!ELEMENT entElement ( #PCDATA ) >
+<!ELEMENT gender ( #PCDATA | entElement )* >
+<!ELEMENT employee (employeeId, name, position, salary, gender, address) >
+<!ELEMENT staff (employee)+>
+<!ATTLIST entElement
+ attr1 CDATA "Attr">
+<!ATTLIST address
+ domestic CDATA #IMPLIED
+ street CDATA "Yes">
+<!ATTLIST entElement
+ domestic CDATA "MALE" >
+
diff --git a/test/testcases/tests/level3/xpath/files/staff.svg b/test/testcases/tests/level3/xpath/files/staff.svg
new file mode 100644
index 0000000..abc7a98
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/staff.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE svg SYSTEM "staff.dtd" [
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement domestic='Yes'>Element data</entElement><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ATTLIST employee xmlns CDATA #IMPLIED>
+ <!ELEMENT svg (rect, script, employee+)>
+ <!ATTLIST svg
+ xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
+ name CDATA #IMPLIED>
+ <!ELEMENT rect EMPTY>
+ <!ATTLIST rect
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ width CDATA #REQUIRED
+ height CDATA #REQUIRED>
+ <!ELEMENT script (#PCDATA)>
+ <!ATTLIST script type CDATA #IMPLIED>
+ <!ENTITY svgunit SYSTEM "svgunit.js">
+ <!ENTITY svgtest SYSTEM "svgtest.js">
+]>
+<!-- This is comment number 1.-->
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0004</employeeId>
+ <name>Jeny Oconnor</name>
+ <position>Personnel Director</position>
+ <salary>95,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Y&ent1;">27 South Road. Dallas, Texas 98556</address>
+ </employee>
+ <employee xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1/Files">
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </svg>
diff --git a/test/testcases/tests/level3/xpath/files/staff.xml b/test/testcases/tests/level3/xpath/files/staff.xml
new file mode 100644
index 0000000..f89c510
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/staff.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE staff SYSTEM "staff.dtd" [
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement domestic='Yes'>Element data</entElement><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+]>
+<!-- This is comment number 1.-->
+<staff>
+ <employee>
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0004</employeeId>
+ <name>Jeny Oconnor</name>
+ <position>Personnel Director</position>
+ <salary>95,000</salary>
+ <gender>Female</gender>
+ <address domestic="Yes" street="Y&ent1;">27 South Road. Dallas, Texas 98556</address>
+ </employee>
+ <employee>
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </staff>
diff --git a/test/testcases/tests/level3/xpath/files/staffNS.dtd b/test/testcases/tests/level3/xpath/files/staffNS.dtd
new file mode 100644
index 0000000..877a943
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/staffNS.dtd
@@ -0,0 +1,47 @@
+<!ELEMENT staff (employee+,emp:employee,employee) >
+<!ATTLIST staff xmlns CDATA #IMPLIED>
+<!ATTLIST staff xmlns:nist CDATA #IMPLIED>
+<!ELEMENT employee (employeeId,name,position,salary,gender,address) >
+<!ATTLIST employee xmlns CDATA #IMPLIED>
+<!ATTLIST employee xmlns:dmstc CDATA #IMPLIED>
+<!ATTLIST employee xmlns:emp2 CDATA #IMPLIED>
+
+<!ELEMENT employeeId (#PCDATA) >
+
+<!ELEMENT name (#PCDATA) >
+
+<!ELEMENT position (#PCDATA) >
+
+<!ELEMENT salary (#PCDATA) >
+
+<!ELEMENT entElement1 (#PCDATA) >
+<!ELEMENT gender (#PCDATA | entElement1)* >
+<!ATTLIST entElement1 xmlns:local1 CDATA #IMPLIED >
+
+<!ELEMENT address (#PCDATA) >
+<!ATTLIST address dmstc:domestic CDATA #IMPLIED>
+<!ATTLIST address street CDATA #IMPLIED>
+<!ATTLIST address domestic CDATA #IMPLIED>
+<!ATTLIST address xmlns CDATA #IMPLIED>
+
+<!ELEMENT emp:employee (emp:employeeId,nm:name,emp:position,emp:salary,emp:gender,emp:address) >
+<!ATTLIST emp:employee xmlns:emp CDATA #IMPLIED>
+<!ATTLIST emp:employee xmlns:nm CDATA #IMPLIED>
+<!ATTLIST emp:employee defaultAttr CDATA 'defaultVal'>
+
+<!ELEMENT emp:employeeId (#PCDATA) >
+
+<!ELEMENT nm:name (#PCDATA) >
+
+<!ELEMENT emp:position (#PCDATA) >
+
+<!ELEMENT emp:salary (#PCDATA) >
+
+<!ELEMENT emp:gender (#PCDATA) >
+
+<!ELEMENT emp:address (#PCDATA) >
+<!ATTLIST emp:address emp:domestic CDATA #IMPLIED>
+<!ATTLIST emp:address street CDATA #IMPLIED>
+<!ATTLIST emp:address emp:zone ID #IMPLIED>
+<!ATTLIST emp:address emp:district CDATA 'DISTRICT'>
+<!ATTLIST emp:address emp:local1 CDATA 'FALSE'>
diff --git a/test/testcases/tests/level3/xpath/files/staffNS.svg b/test/testcases/tests/level3/xpath/files/staffNS.svg
new file mode 100644
index 0000000..d7c620d
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/staffNS.svg
@@ -0,0 +1,73 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE svg PUBLIC "STAFF" "staffNS.dtd"
+[
+ <!ENTITY ent1 "es">
+ <!ENTITY ent2 "1900 Dallas Road">
+ <!ENTITY ent3 "Texas">
+ <!ENTITY ent4 "<entElement1 xmlns:local1='www.xyz.com'>Element data</entElement1><?PItarget PIdata?>">
+ <!ENTITY ent5 PUBLIC "entityURI" "entityFile" NDATA notation1>
+ <!ENTITY ent6 PUBLIC "uri" "file" NDATA notation2>
+ <!ENTITY ent1 "This entity should be discarded">
+ <!NOTATION notation1 PUBLIC "notation1File">
+ <!NOTATION notation2 SYSTEM "notation2File">
+ <!ELEMENT svg (rect, script, employee+, emp:employee, employee*)>
+ <!ATTLIST svg
+ xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
+ name CDATA #IMPLIED>
+ <!ELEMENT rect EMPTY>
+ <!ATTLIST rect
+ x CDATA #REQUIRED
+ y CDATA #REQUIRED
+ width CDATA #REQUIRED
+ height CDATA #REQUIRED>
+ <!ELEMENT script (#PCDATA)>
+ <!ATTLIST script type CDATA #IMPLIED>
+ <!ENTITY svgunit SYSTEM "svgunit.js">
+ <!ENTITY svgtest SYSTEM "svgtest.js">
+]>
+<!-- This is comment number 1.-->
+<svg xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="100"/><script type="text/ecmascript">&svgtest;&svgunit;</script>
+ <employee xmlns="http://www.nist.gov" xmlns:dmstc="http://www.usa.com">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.usa.com" xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2/Files">
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds
+<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
+<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes" street="Yes">&ent2; Dallas, &ent3;
+ 98554</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.netzero.com" xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2/Files">
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>&ent4;</gender>
+ <address dmstc:domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <emp:employee xmlns:emp="http://www.nist.gov" xmlns:nm="http://www.altavista.com" > <emp:employeeId>EMP0004</emp:employeeId>
+ <nm:name>Jeny Oconnor</nm:name>
+ <emp:position>Personnel Director</emp:position>
+ <emp:salary>95,000</emp:salary>
+ <emp:gender>Female</emp:gender>
+ <emp:address emp:domestic="Yes" street="Y&ent1;" emp:zone="CANADA" emp:local1="TRUE">27 South Road. Dallas, texas 98556</emp:address>
+ </emp:employee>
+ <employee xmlns:emp2="http://www.nist.gov" xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2/Files">
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes" xmlns="http://www.nist.gov">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+ </svg>
diff --git a/test/testcases/tests/level3/xpath/files/staffNS.xml b/test/testcases/tests/level3/xpath/files/staffNS.xml
new file mode 100644
index 0000000..e46a7c5
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/staffNS.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?><?TEST-STYLE PIDATA?>
+<!DOCTYPE staff PUBLIC "STAFF" "staffNS.dtd">
+<staff xmlns="http://www.nist.gov" xmlns:nist="http://www.nist.gov">
+ <employee xmlns:dmstc="http://www.usa.com">
+ <employeeId>EMP0001</employeeId>
+ <name>Margaret Martin</name>
+ <position>Accountant</position>
+ <salary>56,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes">1230 North Ave. Dallas, Texas 98551</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.usa.com">
+ <employeeId>EMP0002</employeeId>
+ <name>Martha Raynolds</name>
+ <position>Secretary</position>
+ <salary>35,000</salary>
+ <gender>Female</gender>
+ <address dmstc:domestic="Yes" street="Yes">1900 Dallas Road Dallas, Texas 98554</address>
+ </employee>
+ <employee xmlns:dmstc="http://www.netzero.com">
+ <employeeId>EMP0003</employeeId>
+ <name>Roger
+ Jones</name>
+ <position>Department Manager</position>
+ <salary>100,000</salary>
+ <gender>Male</gender>
+ <address dmstc:domestic="Yes" street="No">PO Box 27 Irving, texas 98553</address>
+ </employee>
+ <emp:employee xmlns:emp="http://www.nist.gov" xmlns:nm="http://www.altavista.com" > <emp:employeeId>EMP0004</emp:employeeId>
+ <nm:name>Jeny Oconnor</nm:name>
+ <emp:position>Personnel Director</emp:position>
+ <emp:salary>95,000</emp:salary>
+ <emp:gender>Female</emp:gender>
+ <emp:address emp:domestic="Yes" street="Yes" emp:zone="CANADA" emp:local1="TRUE">27 South Road. Dallas, texas 98556</emp:address>
+ </emp:employee>
+ <employee xmlns:emp2="http://www.nist.gov">
+ <employeeId>EMP0005</employeeId>
+ <name>Robert Myers</name>
+ <position>Computer Specialist</position>
+ <salary>90,000</salary>
+ <gender>male</gender>
+ <address street="Yes" xmlns="http://www.nist.gov">1821 Nordic. Road, Irving Texas 98558</address>
+ </employee>
+</staff>
diff --git a/test/testcases/tests/level3/xpath/files/svgtest.js b/test/testcases/tests/level3/xpath/files/svgtest.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/svgtest.js
diff --git a/test/testcases/tests/level3/xpath/files/svgunit.js b/test/testcases/tests/level3/xpath/files/svgunit.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/files/svgunit.js
diff --git a/test/testcases/tests/level3/xpath/metadata.xml b/test/testcases/tests/level3/xpath/metadata.xml
new file mode 100644
index 0000000..4a47a00
--- /dev/null
+++ b/test/testcases/tests/level3/xpath/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2003 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C(r) Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+
+<!DOCTYPE metadata SYSTEM 'dom3.dtd' [
+ <!ENTITY % entities SYSTEM "dom3xpathents.ent">
+ %entities;
+]>
+<metadata xmlns="&level3;">
+</metadata>