|
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 xml query with assign |
|
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 <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Chamaeleo-chamaelon"> |
|
19 <button label="Chameleon"/> |
|
20 <label value="9"/> |
|
21 </hbox> |
|
22 <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Dromaius-novaehollandiae"> |
|
23 <button label="Emu"/> |
|
24 <label value="3"/> |
|
25 </hbox> |
|
26 <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Tyto-alba"> |
|
27 <button label="Barn Owl"/> |
|
28 <label value="8"/> |
|
29 </hbox> |
|
30 <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Corvus-corax"> |
|
31 <button label="Raven"/> |
|
32 <label value="5"/> |
|
33 </hbox> |
|
34 </data> |
|
35 |
|
36 <script src="templates_shared.js"/> |
|
37 |
|
38 <script> |
|
39 <![CDATA[ |
|
40 SimpleTest.waitForExplicitFinish(); |
|
41 |
|
42 var testid ="xml query with assign"; |
|
43 var queryType = "xml"; |
|
44 var isTreeBuilder = false; |
|
45 var needsOpen = false; |
|
46 var notWorkingYet = false; |
|
47 var notWorkingYetDynamic = false; |
|
48 var expectedOutput = document.getElementById("output"); |
|
49 |
|
50 var changes = []; |
|
51 ]]> |
|
52 </script> |
|
53 |
|
54 <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" datasources="animals.xml" querytype="xml" ref="."> |
|
55 <template> |
|
56 <query expr="class/species"> |
|
57 <assign var="?length" expr="string-length(@name)"/> |
|
58 </query> |
|
59 <action> |
|
60 <hbox uri="?"> |
|
61 <button label="?name"/> |
|
62 <label value="?length"/> |
|
63 </hbox> |
|
64 </action> |
|
65 </template> |
|
66 </vbox> |
|
67 |
|
68 </window> |