content/xul/templates/tests/chrome/test_tmpl_xmlquerywithassign.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/xul/templates/tests/chrome/test_tmpl_xmlquerywithassign.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     1.7 +
     1.8 +<!--
     1.9 +  xml query with assign
    1.10 +-->
    1.11 +
    1.12 +<window title="XUL Template Tests" width="500" height="600"
    1.13 +        onload="test_template();"
    1.14 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    1.15 +  <script type="application/javascript"
    1.16 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.17 +
    1.18 +  <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
    1.19 +
    1.20 +  <data id="output">
    1.21 +    <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Chamaeleo-chamaelon">
    1.22 +      <button label="Chameleon"/>
    1.23 +      <label value="9"/>
    1.24 +    </hbox>
    1.25 +    <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Dromaius-novaehollandiae">
    1.26 +      <button label="Emu"/>
    1.27 +      <label value="3"/>
    1.28 +    </hbox>
    1.29 +    <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Tyto-alba">
    1.30 +      <button label="Barn Owl"/>
    1.31 +      <label value="8"/>
    1.32 +    </hbox>
    1.33 +    <hbox id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Corvus-corax">
    1.34 +      <button label="Raven"/>
    1.35 +      <label value="5"/>
    1.36 +    </hbox>
    1.37 +  </data>
    1.38 +
    1.39 +<script src="templates_shared.js"/>
    1.40 +
    1.41 +<script>
    1.42 +<![CDATA[
    1.43 +SimpleTest.waitForExplicitFinish();
    1.44 +
    1.45 +var testid ="xml query with assign";
    1.46 +var queryType = "xml";
    1.47 +var isTreeBuilder = false;
    1.48 +var needsOpen = false;
    1.49 +var notWorkingYet = false;
    1.50 +var notWorkingYetDynamic = false;
    1.51 +var expectedOutput = document.getElementById("output");
    1.52 +
    1.53 +var changes = [];
    1.54 +]]>
    1.55 +</script>
    1.56 +
    1.57 +<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" datasources="animals.xml" querytype="xml" ref=".">
    1.58 +<template>
    1.59 +<query expr="class/species">
    1.60 +<assign var="?length" expr="string-length(@name)"/>
    1.61 +</query>
    1.62 +<action>
    1.63 +<hbox uri="?">
    1.64 +<button label="?name"/>
    1.65 +<label value="?length"/>
    1.66 +</hbox>
    1.67 +</action>
    1.68 +</template>
    1.69 +</vbox>
    1.70 +
    1.71 +</window>

mercurial