Subversion Repositories Kolibri OS

Rev

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

  1. <?xml version="1.0" standalone="no"?>
  2. <?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
  3. <!--
  4.  Copyright (c) 2003 X-Hive Corporation
  5.  
  6.  All Rights Reserved. This work is distributed under the W3C(r)
  7.  Software License [1] in the hope that it will be useful, but WITHOUT
  8.  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9.  FITNESS FOR A PARTICULAR PURPOSE.
  10.  
  11.  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  12. -->
  13.  
  14.  
  15. <!DOCTYPE test SYSTEM "dom3.dtd" [
  16.   <!ENTITY % entities SYSTEM "dom3tests.ent">
  17.   %entities;
  18. ]>
  19.  
  20. <test xmlns="&level3;" name="DOMBuilderTest2">
  21.   <metadata>
  22.     <title>DOMBuilderTest2</title>
  23.     &creator;
  24.     <description>Uses LSParser.parseWithContext to append a document as a child of an existing node.</description>
  25.     &contributor; &date;
  26.     <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save#LS-LSParser-parseWithContext"/>
  27.   </metadata>
  28.  
  29.   <var name="elementList" type="NodeList"/>
  30.   <var name="stringDoc"   type="DOMString"/>
  31.   <var name="firstElt0"   type="Element"/>
  32.   <var name="returnNode"  type="Node"/>
  33.   <var name="resourceURI" type="DOMString"/>
  34.  
  35.   &vars;
  36.   &init;
  37.  
  38.   <getResourceURI var="resourceURI" href="TEST0" contentType="text/xml"/>
  39.   <parseURI  var="document" obj="parser" uri="resourceURI"/>
  40.   <getElementsByTagName interface="Document" obj="document" tagname="&quot;elt0&quot;" var="elementList"/>
  41.   <assertSize collection="elementList" size="1" id="count_elt0"/>
  42.  
  43.   <item interface="NodeList" obj="elementList" var="firstElt0" index="0"/>
  44.  
  45.   <getResourceURI var="resourceURI" href="TEST2" contentType="text/xml"/>
  46.   <systemId obj="inputSource" value="resourceURI" interface="LSInput"/>
  47.   <try>
  48.           <parseWithContext  obj="parser" input="inputSource" contextArg="firstElt0" action="ACTION_APPEND_AS_CHILDREN" var="returnNode"/>
  49.          <catch>
  50.                  <DOMException code="NOT_SUPPORTED_ERR">
  51.                          <return/>
  52.                  </DOMException>
  53.          </catch>
  54.   </try>
  55.   <getElementsByTagName interface="Document" obj="document" tagname="&quot;elt2&quot;" var="elementList"/>
  56.   <assertSize collection="elementList" size="2" id="count_elt2"/>
  57.  
  58.   <getElementsByTagName interface="Document" obj="document" tagname="&quot;elt3&quot;" var="elementList"/>
  59.   <assertSize collection="elementList" size="1" id="count_elt3"/>
  60.  
  61. </test>
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.