summaryrefslogtreecommitdiff
path: root/test/testcases/tests/level3/ls/SystemId2.xml
blob: 2447617f3bea48215bccd5e61997718fd2a1ac6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
<!--

Copyright (c) 2003 World Wide Web Consortium, 
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University).  All 
Rights Reserved.  This program is distributed under the W3C's Software
Intellectual Property License.  This program is distributed in the 
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  

See W3C License http://www.w3.org/Consortium/Legal/ for more details.

-->
<!DOCTYPE test SYSTEM "dom3.dtd">


<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="SystemId2">
  <metadata>
    <title>SystemId2</title>
    <creator>Curt Arnold</creator>
    <description>Writes a document to a URL for a temporary http document and rereads the document.</description>
	<date qualifier="created">2003-12-08</date>
	<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save#LS-LSInput-systemId"/>
	<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save#LS-LSOutput-systemId"/>
  </metadata>
  <implementationAttribute name="validating" value="false"/>
  
  <var name="testDoc" type="Document"/>
  <var name="domImpl" type="DOMImplementationLS"/>
  <var name="output" type="LSOutput"/>
  <var name="serializer" type="LSSerializer"/>
  <var name="systemId" type="DOMString"/>
  <var name="checkSystemId" type="DOMString"/>
  <var name="status" type="boolean"/>
  <var name="input" type="LSInput"/>
  <var name="parser" type="LSParser"/>
  <var name="checkDoc" type="Document"/>
  <var name="docElem" type="Element"/>
  <var name="docElemName" type="DOMString"/>
  <var name="NULL_SCHEMA_TYPE" type="DOMString" isNull="true"/>
  
  <load var="testDoc" href="test0" willBeModified="false"/>
  <implementation var="domImpl"/>
  
  <!--   create an LSOutput and connect it to an stock LSWriter   -->
  <createLSOutput var="output" obj="domImpl"/>
  <!--   check that it was initially null    -->
  <systemId var="checkSystemId" obj="output" interface="LSOutput"/>
  <assertNull actual="checkSystemId" id="LSOutputSystemIdInitiallyNull"/>
  <createTempURI var="systemId" scheme="http"/>
  <systemId obj="output" value="systemId" interface="LSOutput"/>
  <systemId var="checkSystemId" obj="output" interface="LSOutput"/>
  <assertEquals expected="systemId" 
  	actual="checkSystemId" 
  	ignoreCase="false" 
  	id="LSOutputSystemIdMatch"/>
  
  <!--   create a serializer and write a test document    -->
  <createLSSerializer var="serializer" obj="domImpl"/>
  <write var="status" obj="serializer" destination="output" nodeArg="testDoc"/>
  <assertTrue actual="status" id="writeStatus"/>
  
  <!--   read the serialized document   -->
  <createLSInput var="input" obj="domImpl"/>
  <systemId var="checkSystemId" obj="input" interface="LSInput"/>
  <assertNull actual="checkSystemId" id="LSInputSystemIdInitiallyNull"/>
  <systemId obj="input" value="systemId" interface="LSInput"/>
  <systemId var="checkSystemId" obj="input" interface="LSInput"/>
  <assertEquals expected="systemId" 
  	actual="checkSystemId" 
  	ignoreCase="false" 
  	id="LSInputSystemIdMatch"/>
  <createLSParser var="parser" obj="domImpl" schemaType="NULL_SCHEMA_TYPE" mode="1"/>
  <parse var="checkDoc" obj="parser" input="input"/>
  <assertNotNull actual="checkDoc" id="checkNotNull"/>
  <documentElement var="docElem" obj="checkDoc"/>
  <nodeName var="docElemName" obj="docElem"/>
  <assertEquals expected='"elt0"' actual="docElemName" id="checkDocElemName" ignoreCase="false"/>  
</test>