summaryrefslogtreecommitdiff
path: root/test/testcases/tests/level3/xpath/XPathNSResolver_lookupNamespaceURI_null.xml
blob: b628bfacff67d6eca74fbd4f0572f5017583a133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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>