content/xul/templates/tests/chrome/test_tmpl_xmlquerywithmultiplequeries.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_xmlquerywithmultiplequeries.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     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 multiple queries
    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 +    <button id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Dromaius-novaehollandiae" label="(Dromaius-novaehollandiae) is a large bird"/>
    1.22 +    <button id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Tyto-alba" label="(Tyto-alba) Barn Owl"/>
    1.23 +    <button id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Corvus-corax" label="(Corvus-corax) Raven"/>
    1.24 +    <label id="chrome://mochitests/content/chrome/content/xul/templates/tests/chrome/animals.xml#Chamaeleo-chamaelon" value="Chameleon"/>
    1.25 +  </data>
    1.26 +
    1.27 +<script src="templates_shared.js"/>
    1.28 +
    1.29 +<script>
    1.30 +<![CDATA[
    1.31 +SimpleTest.waitForExplicitFinish();
    1.32 +
    1.33 +var testid ="xml query with multiple queries";
    1.34 +var queryType = "xml";
    1.35 +var isTreeBuilder = false;
    1.36 +var needsOpen = false;
    1.37 +var notWorkingYet = false;
    1.38 +var notWorkingYetDynamic = false;
    1.39 +var expectedOutput = document.getElementById("output");
    1.40 +
    1.41 +var changes = [];
    1.42 +]]>
    1.43 +</script>
    1.44 +
    1.45 +<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" datasources="animals.xml" querytype="xml" ref=".">
    1.46 +<template>
    1.47 +<queryset>
    1.48 +<query expr="class[position()&gt;1]/species">
    1.49 +<assign var="?id" expr="concat('(', @id, ')')"/>
    1.50 +</query>
    1.51 +<rule>
    1.52 +<where subject="?id" rel="equals" value="(Dromaius-novaehollandiae)"/>
    1.53 +<action>
    1.54 +<button uri="?" label="?id is a large bird"/>
    1.55 +</action>
    1.56 +</rule>
    1.57 +<rule>
    1.58 +<binding subject="?" predicate="@name" object="?name"/>
    1.59 +<action>
    1.60 +<button uri="?" label="?id ?name"/>
    1.61 +</action>
    1.62 +</rule>
    1.63 +</queryset>
    1.64 +<queryset>
    1.65 +<query expr="class[name/text()='Reptiles']/species"/>
    1.66 +<action>
    1.67 +<label uri="?" value="?name"/>
    1.68 +</action>
    1.69 +</queryset>
    1.70 +</template>
    1.71 +</vbox>
    1.72 +
    1.73 +</window>

mercurial