summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-09-16 23:09:21 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-09-16 23:09:21 (GMT)
commit959224050cbceb024588bf0b49c57c503c299beb (patch)
tree50dfbf7f2c05e0974349b19c3f78e7681561a495 /src/uscxml/Interpreter.cpp
parent2196f12c9f31b9858fedc477bbe9d5dbd2f87147 (diff)
downloaduscxml-959224050cbceb024588bf0b49c57c503c299beb.zip
uscxml-959224050cbceb024588bf0b49c57c503c299beb.tar.gz
uscxml-959224050cbceb024588bf0b49c57c503c299beb.tar.bz2
fixed json in ecmascript data
Diffstat (limited to 'src/uscxml/Interpreter.cpp')
-rw-r--r--src/uscxml/Interpreter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index b1c504c..f965e1e 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -250,9 +250,15 @@ void Interpreter::initializeData(const Arabica::DOM::Node<std::string>& data) {
_dataModel->assign(ATTR(data, "id"), value);
} else if (data.hasChildNodes()) {
// search for the text node with the actual script
- Data value = Data(data);
+ NodeList<std::string> dataChilds = data.getChildNodes();
+ for (int i = 0; i < dataChilds.getLength(); i++) {
+ if (dataChilds.item(i).getNodeType() == Node_base::TEXT_NODE) {
+ Data value = Data(dataChilds.item(i), Data::INTERPRETED);
+ _dataModel->assign(ATTR(data, "id"), value);
+ break;
+ }
+ }
// std::cout << value << std::endl;
- _dataModel->assign(ATTR(data, "id"), value);
}
} catch (Event e) {
@@ -1406,6 +1412,7 @@ Arabica::DOM::Node<std::string> Interpreter::findLCCA(const Arabica::XPath::Node
Arabica::DOM::Node<std::string> Interpreter::getState(const std::string& stateId) {
// first try atomic and compund states
+ std::cout << _nsPrefix << stateId << std::endl;
NodeSet<std::string> target = _xpath.evaluate("//" + _nsPrefix + "state[@id='" + stateId + "']", _doc).asNodeSet();
if (target.size() > 0)
goto FOUND;