summaryrefslogtreecommitdiffstats
path: root/test/samples/apache/datamodel-03.xml
diff options
context:
space:
mode:
Diffstat (limited to 'test/samples/apache/datamodel-03.xml')
-rw-r--r--test/samples/apache/datamodel-03.xml259
1 files changed, 0 insertions, 259 deletions
diff --git a/test/samples/apache/datamodel-03.xml b/test/samples/apache/datamodel-03.xml
deleted file mode 100644
index f8a3310..0000000
--- a/test/samples/apache/datamodel-03.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- A fictitious state machine used by test cases. Meant to illustrate
- prefixed XPath expressions in the Commons SCXML Data() function.
- Used by org.apache.commons.scxml.NamespacePrefixedPathsTest
- Also serves as testing the underlying functionality of the
- underlying parsing technology (here, Digester 1.8) -->
-<scxml xmlns="http://www.w3.org/2005/07/scxml"
- xmlns:cs="http://commons.apache.org/scxml"
- version="1.0"
- initialstate="ten">
-
- <!-- Root data model -->
- <datamodel>
-
- <!-- We'll use this for XPaths -->
- <data id="rootdata"
- xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3">
- <ns1:root>
- <ns2:foo>
- <ns3:bar>1</ns3:bar>
- </ns2:foo>
- </ns1:root>
- </data>
-
- <!-- We'll use this for the JUnit test
- NamespacePrefixedPathsTest.java (scxml package) -->
- <data id="retval" />
-
- </datamodel>
-
- <!-- State data model -->
- <state id="ten">
-
- <datamodel>
-
- <data id="data10" xmlns:ns4="scheme://namespace.test.domain/1">
- <root xmlns="">
- <ns4:foo>
- <bar>10</bar>
- </ns4:foo>
- </root>
- </data>
-
- </datamodel>
-
- <onentry>
- <cs:var xmlns:pre1="scheme://namespace.test.domain/1"
- xmlns:pre2="scheme://namespace.test.domain/2"
- xmlns:pre3="scheme://namespace.test.domain/3"
- name="tentest"
- expr="${Data(rootdata,'pre1:root/pre2:foo/pre3:bar') + Data(data10,'root/pre1:foo/bar')}" />
- </onentry>
-
- <transition event="ten.done"
- cond="${tentest eq 11}"
- target="twenty" />
-
- <onexit>
- <assign name="retval"
- expr="${tentest}" />
- </onexit>
-
- </state>
-
- <!-- Already defined (and different) prefixes -->
- <state id="twenty" xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3">
-
- <datamodel>
-
- <data id="data20">
- <ns1:root>
- <ns2:foo>20</ns2:foo>
- </ns1:root>
- </data>
-
- </datamodel>
-
- <onentry>
- <assign location="${Data(rootdata,'ns1:root/ns2:foo/ns3:bar')}"
- expr="${2}" />
- </onentry>
-
-
- <!-- Redefine namespace prefixes -->
- <transition event="twenty.done"
- xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- cond="${Data(data20,'ns1:root/ns2:foo') eq 20 and Data(rootdata,'ns1:root/ns2:foo/ns3:bar') eq 2}"
- target="thirty" />
-
- <onexit>
-
- <!-- Redefine different prefixes bound to above namespaces -->
- <if xmlns:pre1="scheme://namespace.test.domain/1"
- xmlns:pre2="scheme://namespace.test.domain/2"
- cond="${Data(data20,'pre1:root/pre2:foo') lt 20}">
-
- <assign name="retval" expr="Less than 20" />
-
- <elseif cond="${Data(data20,'pre1:root/pre2:foo') eq 20}" />
-
- <assign name="retval" expr="Equal to 20" />
-
- <else/>
-
- <assign name="retval" expr="Greater than 20" />
-
- </if>
-
- </onexit>
-
- </state>
-
- <!-- XPath looking at attribute -->
- <state id="thirty">
-
- <datamodel>
-
- <data id="data30">
- <root xmlns="scheme://namespace.test.domain/1">
- <foo xmlns="scheme://namespace.test.domain/2"
- xmlns:ns1="scheme://namespace.test.domain/3"
- ns1:attfoo="30" attbar="300"/>
- </root>
- </data>
-
- </datamodel>
-
- <transition event="thirty.done"
- xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3"
- cond="${Data(data30,'ns1:root/ns2:foo/@ns3:attfoo') + Data(data30,'ns1:root/ns2:foo/@attbar') eq 330}"
- target="forty" />
-
- </state>
-
- <!-- Multiple data, already defined prefixes -->
- <state id="forty" xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3"
- xmlns:ns4="scheme://namespace.test.domain/4">
-
- <datamodel>
-
- <data id="data40">
- <root xmlns="">
- <ns1:foo ns2:attfoo="40"/>
- </root>
- </data>
-
- <data id="data41">
- <ns3:root>
- <ns4:foo>41</ns4:foo>
- </ns3:root>
- </data>
-
- </datamodel>
-
- <transition event="forty.done"
- cond="${Data(data40,'root/ns1:foo/@ns2:attfoo') + Data(data41,'ns3:root/ns4:foo') eq 81}"
- target="fifty" />
-
- </state>
-
- <!-- Multiple data, prefixes on elements -->
- <state id="fifty">
-
- <datamodel>
-
- <data id="data50" xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3">
- <ns1:root>
- <ns2:foo ns3:attfoo="50"/>
- </ns1:root>
- </data>
-
- <data id="data51" xmlns:ns3="scheme://namespace.test.domain/3"
- xmlns:ns4="scheme://namespace.test.domain/4">
- <ns3:root>
- <ns4:foo attfoo="51"/>
- </ns3:root>
- </data>
-
- </datamodel>
-
- <transition event="fifty.done"
- xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3"
- xmlns:ns4="scheme://namespace.test.domain/4"
- cond="${Data(data50,'ns1:root/ns2:foo/@ns3:attfoo') + Data(rootdata,'ns1:root/ns2:foo/ns3:bar') eq 52}"
- target="sixty" />
-
- </state>
-
- <!-- Multiple data, prefixes on datamodel and transition elements -->
- <state id="sixty">
-
- <datamodel xmlns:ns1="scheme://namespace.test.domain/1"
- xmlns:ns2="scheme://namespace.test.domain/2"
- xmlns:ns3="scheme://namespace.test.domain/3"
- xmlns:ns4="scheme://namespace.test.domain/4">
-
- <data id="data60">
- <root xmlns="">
- <ns1:foo ns2:attfoo="60"/>
- </root>
- </data>
-
- <data id="data61">
- <ns3:root>
- <ns4:foo attfoo="61"/>
- </ns3:root>
- </data>
-
- </datamodel>
-
- <transition event="sixty.done"
- xmlns:pre1="scheme://namespace.test.domain/1"
- xmlns:pre2="scheme://namespace.test.domain/2"
- xmlns:pre3="scheme://namespace.test.domain/3"
- xmlns:pre4="scheme://namespace.test.domain/4"
- cond="${Data(data60,'root/pre1:foo/@pre2:attfoo') + Data(data61,'pre3:root/pre4:foo/@attfoo') eq 121}"
- target="seventy">
-
- <!-- should be 121 -->
- <log expr="${Data(data60,'root/pre1:foo/@pre2:attfoo') + Data(data61,'pre3:root/pre4:foo/@attfoo')}"/>
-
- </transition>
-
- </state>
-
- <state id="seventy" final="true" />
-
-</scxml>
-
-