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="XPathEvaluator_createExpression_NAMESPACE_ERR_02">
  20.   <metadata>
  21.     <title>XPathEvaluator_createExpression_NAMESPACE_ERR_02</title>
  22.     <creator>Philippe Le Hégaret</creator>
  23.     <description>
  24.       The XPathEvaluator can create a "XPathExpression" using the method
  25.       "createExpression(expression, resolver)".
  26.      
  27.       Retrieve the DOM document on which the
  28.       'createExpression("/staff/jfouffa:employee", resolver)' method is
  29.       invoked with the document element. The method should fail to create
  30.       pre-compiled expression and throws DOMException.NAMESPACE_ERR
  31.       since the prefix jfouffa is not mapped.
  32.     </description>
  33.     <date qualifier="created">2002-04-26</date>
  34.     <subject resource="&spec;#XPathEvaluator-createExpression"/>
  35.   </metadata>
  36.   &vars;
  37.   <var name="exp" type="XPathExpression"/>
  38.   <var name="root" type='Element'/>
  39.   <var name="resolver" type="XPathNSResolver"/>
  40.  
  41.   &findXPathEvaluator;
  42.  
  43.   <documentElement obj='doc' var='root'/>
  44.  
  45.   <createNSResolver obj="xpEvaluator" nodeResolver="root"
  46.      var="resolver"/>
  47.  
  48.   <assertDOMException id="throw_NAMESPACE_ERR">
  49.     <NAMESPACE_ERR>
  50.       <createExpression obj='xpEvaluator' var='exp'
  51.         expression='&quot;/staff/jfouffa:employee&quot;' resolver='resolver' />
  52.     </NAMESPACE_ERR>
  53.   </assertDOMException>  
  54.  
  55. </test>
  56.