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.  
  5. Copyright (c) 2003 World Wide Web Consortium,
  6. (Massachusetts Institute of Technology, Institut National de
  7. Recherche en Informatique et en Automatique, Keio University).  All
  8. Rights Reserved.  This program is distributed under the W3C's Software
  9. Intellectual Property License.  This program is distributed in the
  10. hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  11. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE.  
  13.  
  14. See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  15.  
  16. -->
  17. <!DOCTYPE test SYSTEM "dom3.dtd">
  18.  
  19.  
  20. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="DOMWriterTest5">
  21.  <metadata>
  22.    <title>DOMWriterTest5</title>
  23.    <creator>Curt Arnold</creator>
  24.    <description>Creates an document containing a namespaced attribute node without
  25.    user-specified prefix and checks that it is serialized properly.</description>
  26.         <date qualifier="created">2003-12-22</date>
  27.         <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save#LS-LSSerializer-write"/>
  28.         <subject resource="http://lists.w3.org/Archives/Public/www-dom/2003OctDec/0062.html"/>
  29.  </metadata>
  30.  <implementationAttribute name="namespaceAware" value="true"/>
  31.  
  32.  <var name="domImpl" type="DOMImplementation"/>
  33.  <var name="origDoc" type="Document"/>
  34.  <var name="nullDocType" type="DocumentType" isNull="true"/>
  35.  <var name="namespaceURI" type="DOMString" value='"http://www.example.com/DOMWriterTest5"'/>
  36.  <var name="docElem" type="Element"/>
  37.  <var name="outputString" type="DOMString"/>
  38.  <var name="input" type="LSInput"/>
  39.  <var name="serializer" type="LSSerializer"/>
  40.  <var name="parser" type="LSParser"/>
  41.  <var name="NULL_SCHEMA_TYPE" type="DOMString" isNull="true"/>
  42.  <var name="attrValue" type="DOMString"/>
  43.  <var name="parsedDoc" type="Document"/>
  44.  <var name="docElemLocalName" type="DOMString"/>
  45.  <var name="docElemNS" type="DOMString"/>
  46.  
  47.  <implementation var="domImpl"/>
  48.  <createDocument var="origDoc" obj="domImpl"
  49.         namespaceURI="namespaceURI"
  50.    qualifiedName='"test"'
  51.    doctype="nullDocType"/>
  52.  <documentElement var="docElem" obj="origDoc"/>
  53.  <setAttributeNS obj="docElem" namespaceURI="namespaceURI" qualifiedName='"attr"' value='"test value"'/>
  54.  
  55.  
  56.  <!--   create a serializer and write the document    -->
  57.  <createLSSerializer var="serializer" obj="domImpl"/>
  58.  <writeToString var="outputString" obj="serializer" nodeArg="origDoc"/>
  59.  
  60.  <!--   create an LSInput   -->
  61.  <createLSInput var="input" obj="domImpl"/>
  62.  <stringData obj="input" value="outputString"/>
  63.  
  64.  <!--   create parser  -->
  65.  <createLSParser var="parser" obj="domImpl" mode="1" schemaType="NULL_SCHEMA_TYPE"/>
  66.  <parse var="parsedDoc" obj="parser" input="input"/>
  67.  
  68.  <documentElement var="docElem" obj="parsedDoc"/>
  69.  
  70.  <!--  check local name of document element  -->
  71.  <localName var="docElemLocalName" obj="docElem"/>
  72.  <assertEquals actual="docElemLocalName" expected='"test"' ignoreCase="false" id="docElemLocalName"/>
  73.  
  74.  <!--   namespace of document element   -->
  75.  <namespaceURI var="docElemNS" obj="docElem" interface="Node"/>
  76.  <assertEquals actual="docElemNS" expected="namespaceURI" ignoreCase="false" id="docElemNS"/>
  77.  
  78.  <!--  attribute with namespaceURI namespace  -->
  79.  <getAttributeNS var="attrValue" obj="docElem" namespaceURI="namespaceURI" localName='"attr"'/>
  80.  <assertEquals actual="attrValue" expected='"test value"' ignoreCase="false" id="properNSAttrValue"/>
  81.  
  82.  
  83. </test>
  84.  
  85.  
  86.  
  87.  
  88.  
  89.