summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md39
-rw-r--r--src/uscxml/Factory.h5
-rw-r--r--src/uscxml/Interpreter.cpp27
-rw-r--r--src/uscxml/Message.h2
-rw-r--r--src/uscxml/interpreter/InterpreterDraft6.cpp4
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp38
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h3
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp2
-rw-r--r--test/samples/w3c/tests/test153.scxml2
-rw-r--r--test/samples/w3c/tests/test224.scxml4
-rw-r--r--test/samples/w3c/tests/test226.scxml2
-rw-r--r--test/samples/w3c/tests/test301.scxml2
-rw-r--r--test/samples/w3c/tests/test302.scxml2
-rw-r--r--test/samples/w3c/tests/test303.scxml2
-rw-r--r--test/samples/w3c/tests/test304.scxml2
-rw-r--r--test/samples/w3c/tests/test307.scxml2
-rw-r--r--test/samples/w3c/tests/test321.scxml2
-rw-r--r--test/samples/w3c/tests/test322.scxml7
-rw-r--r--test/samples/w3c/tests/test323.scxml2
-rw-r--r--test/samples/w3c/tests/test330.scxml6
-rw-r--r--test/samples/w3c/tests/test403c.scxml2
-rw-r--r--test/samples/w3c/tests/test539.txt4
-rw-r--r--test/samples/w3c/tests/test540.txt3
-rw-r--r--test/samples/w3c/tests/test552.txt2
-rw-r--r--test/samples/w3c/txml/test216sub1.txml.19
-rw-r--r--test/samples/w3c/txml/test277.txml32
-rw-r--r--test/samples/w3c/txml/test561.txml4
-rw-r--r--test/samples/w3c/txml/test568.txml19
-rwxr-xr-xtest/samples/w3c/update-txml.sh3
29 files changed, 177 insertions, 56 deletions
diff --git a/README.md b/README.md
index 679c947..df56af6 100644
--- a/README.md
+++ b/README.md
@@ -33,8 +33,12 @@ the respective build-process.
<table>
<tr><th>Test#</th><th>Status</th><th>Comment</th></tr>
- <tr><td><tt>178</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <tr><td><tt>153</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>The XSLT transformation leave some gibberish in the file</td>
+ <tr><td><tt>178</tt></td><td><tt>Failed / Fix in draft</tt></td>
<td>A manual test that relies on an unspecified _event.raw attribute</td>
+ <tr><td><tt>226</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>Requires a file with wrong file extension</td>
<tr><td><tt>230</tt></td><td><tt>False report</tt></td>
<td>A manual test that is not actually failing but does not end in a state called <tt>pass</tt></td>
<tr><td><tt>250</tt></td><td><tt>False report</tt></td>
@@ -44,11 +48,23 @@ the respective build-process.
is considered non-conformant, and the platform must reject it"</i> -- USCXML will try to evaluate the
rest of the document nevertheless.</td>
</tr>
+ <tr><td><tt>302</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>datamodel attribute is missing from test</td>
+ <tr><td><tt>303</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>datamodel attribute is missing from test</td>
+ <tr><td><tt>304</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>datamodel attribute is missing from test</td>
<tr><td><tt>307</tt></td><td><tt>False report</tt></td>
<td>A manual test that is not actually failing but does not end in a state called <tt>pass</tt></td>
- <tr><td><tt>329</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <tr><td><tt>321</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>Gibberish form XSLT transformation still inside <tt>$_sessionid</tt></td>
+ <tr><td><tt>323</tt></td><td><tt>Failed / Fix in test</tt></td>
+ <td>Gibberish form XSLT transformation still inside <tt>$_name</tt></td>
+ <tr><td><tt>329</tt></td><td><tt>Failed / Raise on ML</tt></td>
<td>Tests that <tt>_event</tt> cannot be assigned, but I like to add attributes to _event to have a
- scope that only lasts for one event. Will raise the issue on the ML.</td>
+ scope that only lasts for one event</td>
+ <tr><td><tt>330</tt></td><td><tt>Failed</tt></td>
+ <td>Namespace issues</td>
<tr><td><tt>333</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
<td><i>"sendid [...] Otherwise it must leave it blank."</i> -- USCXML sets this to the empty string instead of <tt>null</tt>.</td>
<tr><td><tt>335</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
@@ -59,7 +75,22 @@ the respective build-process.
<td><i>"invokeid [...] Otherwise it must leave it blank."</i> -- USCXML sets this to the empty string instead of <tt>null</tt>.</td>
<tr><td><tt>346</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
<td><i>"test that any attempt to change the value of a system variable causes error.execution to be raised."</i> -- I like to edit _event.</td>
-
+ <tr><td><tt>436</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <td>Requires <tt>NULL</tt> datamodel</td>
+ <tr><td><tt>441b</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <td>Requires <tt>NULL</tt> datamodel</td>
+ <tr><td><tt>456</tt></td><td><tt>Failed / Raise on ML</tt></td>
+ <td>Expects undefined + 1 to be 1</td>
+ <tr><td><tt>463 - 486b</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <td>Requires <tt>xpath</tt> datamodel</td>
+ <tr><td><tt>488</tt></td><td><tt>Failed / Raise on ML</tt></td>
+ <td>Expects _event.data to be the empty string when we have it as undefined</td>
+ <tr><td><tt>537 - 547</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <td>Requires <tt>xpath</tt> datamodel</td>
+ <tr><td><tt>555</tt></td><td><tt>Failed / Won't&nbsp;fix</tt></td>
+ <td>Requires <tt>xpath</tt> datamodel</td>
+ <tr><td><tt>569</tt></td><td><tt>Failed</tt></td>
+ <td>SCXML I/O processor is implicit at the moment</td>
</table>
diff --git a/src/uscxml/Factory.h b/src/uscxml/Factory.h
index 65dc5fd..990b035 100644
--- a/src/uscxml/Factory.h
+++ b/src/uscxml/Factory.h
@@ -243,6 +243,7 @@ public:
virtual void eval(const std::string& expr) = 0;
virtual std::string evalAsString(const std::string& expr) = 0;
virtual bool evalAsBool(const std::string& expr) = 0;
+ virtual void assign(const std::string& location, const Arabica::DOM::Document<std::string>& doc) = 0;
virtual void assign(const std::string& location, const std::string& expr) = 0;
virtual void assign(const std::string& location, const Data& data) = 0;
virtual bool isDeclared(const std::string& expr) = 0;
@@ -305,6 +306,10 @@ public:
return _impl->evalAsBool(expr);
}
+ virtual void assign(const std::string& location, const Arabica::DOM::Document<std::string>& doc) {
+ return _impl->assign(location, doc);
+ }
+
virtual void assign(const std::string& location, const std::string& expr) {
return _impl->assign(location, expr);
}
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index 5f54cc7..86f40c1 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -289,9 +289,12 @@ void Interpreter::init() {
} else {
LOG(ERROR) << "Cannot find SCXML element" << std::endl;
+ _done = true;
+ return;
}
} else {
LOG(ERROR) << "Interpreter has no DOM at all!" << std::endl;
+ _done = true;
}
_isInitialized = true;
}
@@ -353,12 +356,27 @@ void Interpreter::initializeData(const Node<std::string>& data) {
_cachedURLs[srcURL.asString()] = srcURL;
}
contentToProcess = ss.str();
+
+ // try to parse as XML
+ std::stringstream* xmlStr = new std::stringstream();
+ (*xmlStr) << contentToProcess;
+ std::auto_ptr<std::istream> ssPtr(xmlStr);
+ Arabica::SAX::InputSource<std::string> inputSource;
+ inputSource.setByteStream(ssPtr);
+ Arabica::SAX2DOM::Parser<std::string> parser;
+ if(parser.parse(inputSource) && parser.getDocument()) {
+ _dataModel.assign(ATTR(data, "id"), parser.getDocument());
+ return;
+ }
} else if (data.hasChildNodes()) {
bool presentAsDom = false;
Node<std::string> contentChild = data.getFirstChild();
while(contentChild) {
if (contentChild.getNodeType() == Node_base::TEXT_NODE) {
- break;
+ std::string trimmed = contentChild.getNodeValue();
+ boost::trim(trimmed);
+ if (trimmed.length() > 0)
+ break;
}
if (contentChild.getNodeType() == Node_base::ELEMENT_NODE) {
presentAsDom = true;
@@ -368,7 +386,12 @@ void Interpreter::initializeData(const Node<std::string>& data) {
}
if (contentChild && presentAsDom) {
- LOG(ERROR) << "Passing DOM in data is TODO.";
+ Arabica::DOM::DOMImplementation<std::string> domFactory = Arabica::SimpleDOM::DOMImplementation<std::string>::getDOMImplementation();
+ Document<std::string> dom = domFactory.createDocument(contentChild.getNamespaceURI(), "", 0);
+ Node<std::string> newNode = dom.importNode(contentChild, true);
+ dom.appendChild(newNode);
+ _dataModel.assign(ATTR(data, "id"), dom);
+ return;
} else if (contentChild) {
// get first child and process below
contentToProcess = contentChild.getNodeValue();
diff --git a/src/uscxml/Message.h b/src/uscxml/Message.h
index 19adf99..ae88225 100644
--- a/src/uscxml/Message.h
+++ b/src/uscxml/Message.h
@@ -28,7 +28,7 @@ public:
Data() {}
Data(const std::string& atom_, Type type_ = INTERPRETED) : atom(atom_), type(type_) {}
- Data(const Arabica::DOM::Node<std::string>& dom);
+ explicit Data(const Arabica::DOM::Node<std::string>& dom);
virtual ~Data() {}
static Data fromJSON(const std::string& jsonString);
diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp
index 453e64f..2f05be9 100644
--- a/src/uscxml/interpreter/InterpreterDraft6.cpp
+++ b/src/uscxml/interpreter/InterpreterDraft6.cpp
@@ -13,8 +13,10 @@ void InterpreterDraft6::interpret() {
if (!_isInitialized)
init();
- if (!_scxml)
+ if (!_scxml) {
+ _mutex.unlock();
return;
+ }
// dump();
if (_sessionId.length() == 0)
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index e86472b..1d01e12 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -99,6 +99,7 @@ v8::Handle<v8::Value> V8DataModel::getIOProcessors(v8::Local<v8::String> propert
std::map<std::string, IOProcessor> ioProcessors = dataModel->_interpreter->getIOProcessors();
std::map<std::string, IOProcessor>::const_iterator ioProcIter = ioProcessors.begin();
while(ioProcIter != ioProcessors.end()) {
+ std::cout << ioProcIter->first << std::endl;
dataModel->_ioProcessors->Set(v8::String::New(ioProcIter->first.c_str()),
dataModel->getDataAsValue(ioProcIter->second.getDataModelVariables()));
ioProcIter++;
@@ -143,18 +144,7 @@ void V8DataModel::setEvent(const Event& event) {
eventObj->SetInternalField(0, Arabica::DOM::V8DOM::toExternal(privData));
eventObj.MakeWeak(0, Arabica::DOM::V8SCXMLEvent::jsDestructor);
if (event.dom) {
- // _event.data is a DOM document
- v8::Handle<v8::Function> retCtor = Arabica::DOM::V8Document::getTmpl()->GetFunction();
- v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
-
- struct Arabica::DOM::V8Document::V8DocumentPrivate* retPrivData = new Arabica::DOM::V8Document::V8DocumentPrivate();
- retPrivData->dom = privData->dom;
- retPrivData->nativeObj = (Arabica::DOM::Document<std::string>*)&event.dom;
-
- retObj->SetInternalField(0, Arabica::DOM::V8DOM::toExternal(retPrivData));
- retObj.MakeWeak(0, Arabica::DOM::V8Document::jsDestructor);
-
- eventObj->Set(v8::String::New("data"), retObj);
+ eventObj->Set(v8::String::New("data"), getDocumentAsValue(event.dom));
} else if (event.content.length() > 0) {
// _event.data is a string
eventObj->Set(v8::String::New("data"), v8::String::New(event.content.c_str()));
@@ -253,6 +243,20 @@ Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value) {
return data;
}
+v8::Handle<v8::Value> V8DataModel::getDocumentAsValue(const Arabica::DOM::Document<std::string>& doc) {
+ v8::Handle<v8::Function> retCtor = Arabica::DOM::V8Document::getTmpl()->GetFunction();
+ v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
+
+ struct Arabica::DOM::V8Document::V8DocumentPrivate* retPrivData = new Arabica::DOM::V8Document::V8DocumentPrivate();
+ retPrivData->dom = _dom;
+ retPrivData->nativeObj = new Arabica::DOM::Document<std::string>(doc);
+
+ retObj->SetInternalField(0, Arabica::DOM::V8DOM::toExternal(retPrivData));
+ retObj.MakeWeak(0, Arabica::DOM::V8Document::jsDestructor);
+
+ return retObj;
+}
+
v8::Handle<v8::Value> V8DataModel::getDataAsValue(const Data& data) {
if (data.compound.size() > 0) {
v8::Handle<v8::Object> value = v8::Object::New();
@@ -385,6 +389,16 @@ double V8DataModel::evalAsNumber(const std::string& expr) {
return 0;
}
+void V8DataModel::assign(const std::string& location, const Arabica::DOM::Document<std::string>& doc) {
+ v8::Locker locker;
+ v8::HandleScope handleScope;
+ v8::Context::Scope contextScope(_contexts.front());
+ v8::Handle<v8::Object> global = _contexts.front()->Global();
+
+ global->Set(v8::String::New(location.c_str()), getDocumentAsValue(doc));
+
+}
+
void V8DataModel::assign(const std::string& location, const Data& data) {
v8::Locker locker;
v8::HandleScope handleScope;
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
index 6348cbc..e67e4ca 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
@@ -40,11 +40,13 @@ public:
virtual void popContext();
virtual void eval(const std::string& expr);
+ virtual void assign(const std::string& location, const Arabica::DOM::Document<std::string>& doc);
virtual void assign(const std::string& location, const std::string& expr);
virtual void assign(const std::string& location, const Data& data);
virtual Data getStringAsData(const std::string& content);
virtual Data getValueAsData(const v8::Handle<v8::Value>& value);
+
virtual bool isDeclared(const std::string& expr);
virtual std::string evalAsString(const std::string& expr);
@@ -66,6 +68,7 @@ protected:
v8::Handle<v8::Value> evalAsValue(const std::string& expr);
v8::Handle<v8::Value> getDataAsValue(const Data& data);
+ v8::Handle<v8::Value> getDocumentAsValue(const Arabica::DOM::Document<std::string>& doc);
void throwExceptionEvent(const v8::TryCatch& tryCatch);
};
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
index bbd2538..a142231 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
@@ -49,7 +49,7 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) {
} else if (req.dom) {
_invokedInterpreter = Interpreter::fromDOM(req.dom);
} else if (req.content.size() > 0) {
- LOG(ERROR) << "Instantiating nested SCXML interpreter by content not supported yet";
+ LOG(ERROR) << "Instantiating nested SCXML interpreter by content or expr not supported yet";
} else {
LOG(ERROR) << "Cannot invoke nested SCXML interpreter, neither src attribute nor DOM is given";
}
diff --git a/test/samples/w3c/tests/test153.scxml b/test/samples/w3c/tests/test153.scxml
index c904232..9917789 100644
--- a/test/samples/w3c/tests/test153.scxml
+++ b/test/samples/w3c/tests/test153.scxml
@@ -13,7 +13,7 @@ it ever isn't, set Var4 to 0, indicating failure --><scxml xmlns="http://www.w3.
<state id="s0">
<onentry>
<foreach item="Var2" array="Var3">
- <if cond="Var1 &lt;Var2">
+ <if cond="Var1/text() &lt;Var2/text() ">
<assign location="Var1" expr="Var2"/>
<else/>
<!-- values are out of order, record failure -->
diff --git a/test/samples/w3c/tests/test224.scxml b/test/samples/w3c/tests/test224.scxml
index 585d014..e2e8a32 100644
--- a/test/samples/w3c/tests/test224.scxml
+++ b/test/samples/w3c/tests/test224.scxml
@@ -22,9 +22,7 @@
<state id="s1">
<transition cond="(function(str, starts){if (starts === '') return true;if (str == null || starts == null) return false;str = String(str); starts = String(starts);return str.length &gt;= starts.length &amp;&amp; str.slice(0, starts.length) === starts;})(Var1, Var2)" target="pass"/>
- <transition target="fail">
- <log expr="Var1"/>
- </transition>
+ <transition target="fail"/>
</state>
<final id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final>
diff --git a/test/samples/w3c/tests/test226.scxml b/test/samples/w3c/tests/test226.scxml
index e1c6d3f..c831a1d 100644
--- a/test/samples/w3c/tests/test226.scxml
+++ b/test/samples/w3c/tests/test226.scxml
@@ -9,7 +9,7 @@ success. otherwise it will hang and the timeout in this doc signifies failure.
</onentry>
- <invoke type="http://www.w3.org/TR/scxml/" src="file:test226sub1.scxml">
+ <invoke type="http://www.w3.org/TR/scxml/" src="file:test226sub1.txml">
<param name="Var1" expr="1"/>
</invoke>
diff --git a/test/samples/w3c/tests/test301.scxml b/test/samples/w3c/tests/test301.scxml
index 1c25c6d..59125c8 100644
--- a/test/samples/w3c/tests/test301.scxml
+++ b/test/samples/w3c/tests/test301.scxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!-- the processor should reject this document because it can't download the script.
-Therefore we fail if it runs at all. This test is valid only for datamodels that support scripting --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="ecmascript" version="1.0" initial="s0">
+Therefore we fail if it runs at all. This test is valid only for datamodels that support scripting --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0">
<script src="D:\foo"/>
<state id="s0">
diff --git a/test/samples/w3c/tests/test302.scxml b/test/samples/w3c/tests/test302.scxml
index 21ccdb3..c72a311 100644
--- a/test/samples/w3c/tests/test302.scxml
+++ b/test/samples/w3c/tests/test302.scxml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!-- test that a script is evaluated at load time. <conf:script> shoudl assign the value 1 to
Var1. Hence, if script is evaluated at download time, Var1 has a value in the initial state s0.
-This test is valid only for datamodels that support scripting --><scxml xmlns="http://www.w3.org/2005/07/scxml" datamodel="ecmascript" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0">
+This test is valid only for datamodels that support scripting --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0">
<script>var Var1 = 1</script>
<state id="s0">
diff --git a/test/samples/w3c/tests/test303.scxml b/test/samples/w3c/tests/test303.scxml
index 2fa5b27..dcb3490 100644
--- a/test/samples/w3c/tests/test303.scxml
+++ b/test/samples/w3c/tests/test303.scxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><!-- to test that scripts are run as part of executable content, we check that it changes the value of a var at the
-right point. This test is valid only for datamodels that support scripting --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="ecmascript" version="1.0" initial="s0">
+right point. This test is valid only for datamodels that support scripting --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0">
<datamodel>
<data id="Var1" expr="0"/>
</datamodel>
diff --git a/test/samples/w3c/tests/test304.scxml b/test/samples/w3c/tests/test304.scxml
index 250d0cd..cdb4c22 100644
--- a/test/samples/w3c/tests/test304.scxml
+++ b/test/samples/w3c/tests/test304.scxml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?><!-- test that a variable declared by a script can be accessed like any other part of the data model --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="ecmascript" version="1.0" initial="s0">
+<?xml version="1.0" encoding="UTF-8"?><!-- test that a variable declared by a script can be accessed like any other part of the data model --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0">
<script>var Var1 = 1</script>
<state id="s0">
diff --git a/test/samples/w3c/tests/test307.scxml b/test/samples/w3c/tests/test307.scxml
index 6eff148..3f93f10 100644
--- a/test/samples/w3c/tests/test307.scxml
+++ b/test/samples/w3c/tests/test307.scxml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" datamodel="ecmascript" version="1.0" initial="s0" binding="late">
+<?xml version="1.0" encoding="UTF-8"?><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" version="1.0" initial="s0" binding="late">
<!-- with binding=late, in s0 we access a variable that isn't created until we get to s1. Then in s1
we access a non-existent substructure of a variable. We use log tags to report the values that both operations
diff --git a/test/samples/w3c/tests/test321.scxml b/test/samples/w3c/tests/test321.scxml
index 66fcf58..fe70937 100644
--- a/test/samples/w3c/tests/test321.scxml
+++ b/test/samples/w3c/tests/test321.scxml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!-- test that _sessionid is bound on startup --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="ecmascript" version="1.0" name="machineName">
<datamodel>
- <data id="Var1" expr="_sessionid"/>
+ <data id="Var1" expr="$_sessionid"/>
</datamodel>
<state id="s0">
diff --git a/test/samples/w3c/tests/test322.scxml b/test/samples/w3c/tests/test322.scxml
index 2c7f536..2d0fee1 100644
--- a/test/samples/w3c/tests/test322.scxml
+++ b/test/samples/w3c/tests/test322.scxml
@@ -12,9 +12,7 @@ be assigned to --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="ht
<state id="s1">
<onentry>
- <log expr="_sessionid" />
<assign location="_sessionid" expr="'otherName'"/>
- <log expr="_sessionid" />
<raise event="foo"/>
</onentry>
@@ -25,10 +23,7 @@ be assigned to --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="ht
<state id="s2">
<transition cond="Var1==_sessionid" target="pass"/>
- <transition target="fail">
- <log expr="_sessionid" />
- <log expr="Var1" />
- </transition>
+ <transition target="fail"/>
</state>
diff --git a/test/samples/w3c/tests/test323.scxml b/test/samples/w3c/tests/test323.scxml
index 43fa9c8..01ca4cb 100644
--- a/test/samples/w3c/tests/test323.scxml
+++ b/test/samples/w3c/tests/test323.scxml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!-- test that _name is bound on startup --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="ecmascript" name="machineName">
<datamodel>
- <data id="Var1" expr="_name"/>
+ <data id="Var1" expr="$_name"/>
</datamodel>
<state id="s0">
diff --git a/test/samples/w3c/tests/test330.scxml b/test/samples/w3c/tests/test330.scxml
index 5488f96..5cbf4bc 100644
--- a/test/samples/w3c/tests/test330.scxml
+++ b/test/samples/w3c/tests/test330.scxml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?><!-- check that the required fields are present in both internal and external events --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="ecmascript" name="machineName">
+<?xml version="1.0" encoding="UTF-8"?><!-- check that the required fields are present in both internal and external events --><scxml xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="ecmascript" name="machineName">
<state id="s0">
<onentry>
@@ -17,7 +17,7 @@
</state>
- <final id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final>
- <final id="fail"><onentry><log label="Outcome" expr="'fail'"/></onentry></final>
+ <final xmlns="http://www.w3.org/2005/07/scxml" id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final>
+ <final xmlns="http://www.w3.org/2005/07/scxml" id="fail"><onentry><log label="Outcome" expr="'fail'"/></onentry></final>
</scxml> \ No newline at end of file
diff --git a/test/samples/w3c/tests/test403c.scxml b/test/samples/w3c/tests/test403c.scxml
index c02425d..9e7fd12 100644
--- a/test/samples/w3c/tests/test403c.scxml
+++ b/test/samples/w3c/tests/test403c.scxml
@@ -6,7 +6,7 @@
<state id="s0" initial="p0">
<onentry>
<raise event="event1"/>
- <send event="timeout" delay="100s"/>
+ <send event="timeout" delay="1s"/>
</onentry>
<transition event="event2" target="fail"/>
<transition event="timeout" target="fail"/>
diff --git a/test/samples/w3c/tests/test539.txt b/test/samples/w3c/tests/test539.txt
new file mode 100644
index 0000000..de1b0a1
--- /dev/null
+++ b/test/samples/w3c/tests/test539.txt
@@ -0,0 +1,4 @@
+ <books xmlns="">
+ <book title="title1"/>
+ <book title="title2"/>
+ </books> \ No newline at end of file
diff --git a/test/samples/w3c/tests/test540.txt b/test/samples/w3c/tests/test540.txt
new file mode 100644
index 0000000..2191239
--- /dev/null
+++ b/test/samples/w3c/tests/test540.txt
@@ -0,0 +1,3 @@
+123
+4 5
+ \ No newline at end of file
diff --git a/test/samples/w3c/tests/test552.txt b/test/samples/w3c/tests/test552.txt
index 0cfbf08..d8263ee 100644
--- a/test/samples/w3c/tests/test552.txt
+++ b/test/samples/w3c/tests/test552.txt
@@ -1 +1 @@
-2
+2 \ No newline at end of file
diff --git a/test/samples/w3c/txml/test216sub1.txml.1 b/test/samples/w3c/txml/test216sub1.txml.1
deleted file mode 100644
index eb4c9df..0000000
--- a/test/samples/w3c/txml/test216sub1.txml.1
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<!-- when invoked, terminate returning done.invoke. This proves that the invocation succeeded. -->
-
-
-<scxml initial="final" version="1.0" conf:datamodel="" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
-
-<final id="final"/>
-
-</scxml> \ No newline at end of file
diff --git a/test/samples/w3c/txml/test277.txml b/test/samples/w3c/txml/test277.txml
new file mode 100644
index 0000000..bd08341
--- /dev/null
+++ b/test/samples/w3c/txml/test277.txml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+
+<!-- test that platform creates undound variable if we assign an illegal value to it. Thus
+ we can assign to it later in state s1. -->
+
+<scxml initial="s0" version="1.0" xmlns="http://www.w3.org/2005/07/scxml" conf:datamodel="" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
+ <datamodel>
+ <data conf:id="1" conf:illegalExpr=""/>
+ </datamodel>
+
+ <state id="s0">
+ <onentry>
+ <raise event="foo"/>
+ </onentry>
+
+ <transition event="error.execution" conf:unboundVar="1" target="s1"/>
+ <transition event="*" conf:targetfail=""/>
+ </state>
+
+ <state id="s1">
+ <onentry>
+ <assign conf:location="1" conf:expr="1"/>
+ </onentry>
+ <transition conf:idVal="1=1" conf:targetpass=""/>
+ <transition conf:targetfail=""/>
+
+ </state>
+
+ <conf:pass/>
+ <conf:fail/>
+
+</scxml> \ No newline at end of file
diff --git a/test/samples/w3c/txml/test561.txml b/test/samples/w3c/txml/test561.txml
index 221145c..4b7ec8e 100644
--- a/test/samples/w3c/txml/test561.txml
+++ b/test/samples/w3c/txml/test561.txml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
- <!-- in the ECMA data model, test that processor creates correct DOM structure in
- _event.data when receiving XML in an event -->
+ <!-- in the ECMA data model, test that processor creates an ECMAScript object
+ _event.data when receiving JSON in an event -->
<scxml xmlns="http://www.w3.org/2005/07/scxml"
xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="ecmascript">
diff --git a/test/samples/w3c/txml/test568.txml b/test/samples/w3c/txml/test568.txml
new file mode 100644
index 0000000..ab00644
--- /dev/null
+++ b/test/samples/w3c/txml/test568.txml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<!-- test that location field is found inside entry for SCXML Event I/O processor in the XPath
+data model. The tests for the relevant event i/o processors will test that it can be used to
+send events. -->
+
+<scxml initial="s0" version="1.0" datamodel="xpath" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">
+
+
+<state id="s0">
+ <transition cond="$_ioprocessors/scxml/location/text()" conf:targetpass=""/>
+ <transition conf:targetfail=""/>
+
+ </state>
+
+ <conf:pass/>
+ <conf:fail/>
+
+</scxml> \ No newline at end of file
diff --git a/test/samples/w3c/update-txml.sh b/test/samples/w3c/update-txml.sh
index dab3cf3..6cf9c01 100755
--- a/test/samples/w3c/update-txml.sh
+++ b/test/samples/w3c/update-txml.sh
@@ -1,4 +1,5 @@
#!/bin/bash
-wget -rl1 http://www.w3.org/Voice/2013/scxml-irp/
+wget -rl1 -Atxml,txt http://www.w3.org/Voice/2013/scxml-irp/
find ./www.w3.org -name *.txml -exec cp {} ./txml \;
+find ./www.w3.org -name *.txt -exec cp {} ./txml \;
rm -rf www.w3.org \ No newline at end of file