Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
  3. <!--
  4.  Copyright (c) 2003 World Wide Web Consortium,
  5.  
  6.  (Massachusetts Institute of Technology, European Research Consortium for
  7.  Informatics and Mathematics, Keio University). All Rights Reserved. This
  8.  work is distributed under the W3C(r) Software License [1] in the hope that
  9.  it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10.  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11.  
  12.  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  13. -->
  14.  
  15. <!DOCTYPE test SYSTEM "dom3.dtd" [
  16.   <!ENTITY % entities SYSTEM "dom3xpathents.ent">
  17.   %entities;
  18. ]>
  19. <test xmlns="&level3;" name="XPathNSResolver_lookupNamespaceURI_xml">
  20.   <metadata>
  21.     <title>XPathNSResolver_lookupNamespaceURI_xml</title>
  22.     <creator>Bob Clary</creator>
  23.     <description>
  24.       Iterate over all elements in the test document, creating
  25.       nsresolvers checking that looking up the xml prefix returns
  26.       http://www.w3.org/XML/1998/namespace.
  27.     </description>
  28.     <date qualifier="created">2003-12-09</date>
  29.     <subject resource="&spec;#XPathEvaluator"/>
  30.     <subject resource="&spec;#XPathEvaluator-createNSResolver"/>
  31.     <subject resource="&spec;#XPathNSResolver"/>
  32.     <subject resource="&spec;#XPathNSResolver-lookupNamespaceURI"/>
  33.   </metadata>
  34.  
  35.   <!-- Standard Variables -->
  36.  
  37.   <var name="doc"                 type="Document" />
  38.   <var name="resolver"            type="XPathNSResolver" />
  39.   <var name="evaluator"           type="XPathEvaluator" />
  40.  
  41.   <!-- Test Variables -->
  42.  
  43.   <var name="element"      type="Element"/>
  44.   <var name="elements"     type="NodeList"/>
  45.   <var name="lookupNamespaceURI" type="DOMString"/>
  46.   <var name="namespaceURI" type="DOMString"/>
  47.   <var name="prefix"       type="DOMString"/>
  48.  
  49.   <!-- Load Test Document -->
  50.  
  51.   <load var="doc" href="staffNS" willBeModified="false"/>
  52.  
  53.   <!-- Test Body -->
  54.  
  55.   <getElementsByTagNameNS obj="doc"
  56.                           interface="Document"
  57.                           var="elements"
  58.                           namespaceURI="&quot;*&quot;"
  59.                           localName="&quot;*&quot;"
  60.                           />
  61.  
  62.   <createXPathEvaluator var='evaluator'
  63.                         document='doc'/>
  64.  
  65.  
  66.   <for-each member="element"
  67.             collection="elements">
  68.  
  69.  
  70.     <createNSResolver obj="evaluator"
  71.                       var="resolver"
  72.                       nodeResolver="element"
  73.                       />
  74.  
  75.     <lookupNamespaceURI obj="resolver"
  76.                         interface="XPathNSResolver"
  77.                         var="lookupNamespaceURI"
  78.                         prefix="&quot;xml&quot;"
  79.                         />
  80.  
  81.     <assertEquals id="equal"
  82.                   actual="lookupNamespaceURI"
  83.                   expected="&quot;http://www.w3.org/XML/1998/namespace&quot;"
  84.                   ignoreCase="false"
  85.                   />
  86.   </for-each>
  87.  
  88. </test>
  89.