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.  
  21. <test xmlns="&level3;" name="DOMInputSourceTest6">
  22.   <metadata>
  23.     <title>DOMInputSourceTest6</title>
  24.     &creator;
  25.     <description>Specify encodings for LSInput with a character stream.  The
  26.     setting should have no effect and the inputEncoding of the resulting document should be UTF-16.</description>
  27.     &contributor; &date;
  28.     <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save#LS-LSInput-encoding"/>
  29.     <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save#LS-LSParser-parse"/>
  30.   </metadata>
  31.   <hasFeature feature='"Core"' version='"3.0"'/>
  32.  
  33.   <var name="encodingString" type="DOMString"/>
  34.  
  35.   <var name="myReader" type="LSReader" value="&quot;&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;elt0&gt;elt0&lt;/elt0&gt;&quot;"/>
  36.  
  37.   &vars;
  38.   &init;
  39.  
  40.   <!--  initialize an input source with a string and a misleading encoding  -->
  41.   <encoding   obj="inputSource" value='"UTF-8"' interface="LSInput"/>
  42.   <characterStream obj="inputSource" value="myReader" interface="LSInput"/>
  43.   <!--  parse   -->
  44.   <parse var="document" obj="parser" input="inputSource"/>
  45.   <assertNotNull actual="document" id="documentNotNull"/>
  46.  
  47.   <!--  check inputEncoding, should be UTF-16   -->
  48.   <inputEncoding var="encodingString" obj="document" interface="Document"/>
  49.   <assertEquals actual="encodingString" expected='"UTF-16"' ignoreCase="true" id="encodingstringcheck0"/>
  50. </test>
  51.  
  52.  
  53.  
  54.  
  55.  
  56.