|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 |
|
5 <!-- |
|
6 extended syntax - two rules recurse |
|
7 --> |
|
8 |
|
9 <window title="XUL Template Tests" width="500" height="600" |
|
10 onload="test_template();" |
|
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
12 <script type="application/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
14 |
|
15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
|
16 |
|
17 <data id="output"> |
|
18 <vbox id="http://www.some-fictitious-zoo.com/humans/sarah"> |
|
19 <label value="The favorite animals of Sarah"/> |
|
20 <label id="http://www.some-fictitious-zoo.com/birds/emu" class="indent" value="Emu which belongs to the class Birds"/> |
|
21 <label id="http://www.some-fictitious-zoo.com/mammals/polarbear" class="indent" value="Polar Bear which belongs to the class Mammals"/> |
|
22 <label id="http://www.some-fictitious-zoo.com/arachnids/tarantula" class="indent" value="Tarantula which belongs to the class Arachnids"/> |
|
23 </vbox> |
|
24 <vbox id="http://www.some-fictitious-zoo.com/humans/robert"> |
|
25 <label value="The favorite animals of Robert"/> |
|
26 <label id="http://www.some-fictitious-zoo.com/arachnids/tarantula" class="indent" value="Tarantula which belongs to the class Arachnids"/> |
|
27 <label id="http://www.some-fictitious-zoo.com/reptiles/anaconda" class="indent" value="Anaconda which belongs to the class Reptiles"/> |
|
28 <label id="http://www.some-fictitious-zoo.com/reptiles/chameleon" class="indent" value="Chameleon which belongs to the class Reptiles"/> |
|
29 <label id="http://www.some-fictitious-zoo.com/mammals/africanelephant" class="indent" value="African Elephant which belongs to the class Mammals"/> |
|
30 </vbox> |
|
31 </data> |
|
32 |
|
33 <script src="templates_shared.js"/> |
|
34 |
|
35 <script> |
|
36 <![CDATA[ |
|
37 SimpleTest.waitForExplicitFinish(); |
|
38 |
|
39 var testid ="extended syntax - two rules recurse"; |
|
40 var queryType = "rdf"; |
|
41 var isTreeBuilder = false; |
|
42 var needsOpen = false; |
|
43 var notWorkingYet = false; |
|
44 var notWorkingYetDynamic = false; |
|
45 var expectedOutput = document.getElementById("output"); |
|
46 |
|
47 var changes = []; |
|
48 ]]> |
|
49 </script> |
|
50 |
|
51 <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" datasources="rdf:null" ref="http://www.some-fictitious-zoo.com/humans"> |
|
52 <template> |
|
53 <rule> |
|
54 <conditions> |
|
55 <content uri="?uri"/> |
|
56 <member container="?uri" child="?child"/> |
|
57 <triple subject="?child" predicate="http://www.some-fictitious-zoo.com/rdf#name" object="?name"/> |
|
58 </conditions> |
|
59 <action> |
|
60 <vbox uri="?child"> |
|
61 <label value="The favorite animals of ?name"/> |
|
62 </vbox> |
|
63 </action> |
|
64 </rule> |
|
65 <rule> |
|
66 <conditions> |
|
67 <content uri="?uri"/> |
|
68 <triple subject="?uri" predicate="http://www.some-fictitious-zoo.com/rdf#favoriteAnimal" object="?child"/> |
|
69 <member container="?animalClass" child="?child"/> |
|
70 <triple subject="?animalClass" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="http://www.some-fictitious-zoo.com/rdf#Class"/> |
|
71 <triple subject="?child" predicate="http://www.some-fictitious-zoo.com/rdf#name" object="?name"/> |
|
72 <triple subject="?animalClass" predicate="http://www.some-fictitious-zoo.com/rdf#name" object="?animalClassName"/> |
|
73 </conditions> |
|
74 <action> |
|
75 <label uri="?child" class="indent" value="?name which belongs to the class ?animalClassName"/> |
|
76 </action> |
|
77 </rule> |
|
78 </template> |
|
79 </vbox> |
|
80 |
|
81 </window> |