summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-12 15:10:36 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-12 15:10:36 (GMT)
commit72fb2cd0bd89eb40d4a96f86d464d9801ad91f59 (patch)
treeea6ec14f4da720b2ec80d9b1c10904f13ee43d32 /src/uscxml/Interpreter.cpp
parentba050afaaad699e60ca657b311d5c34d038bb89c (diff)
downloaduscxml-72fb2cd0bd89eb40d4a96f86d464d9801ad91f59.zip
uscxml-72fb2cd0bd89eb40d4a96f86d464d9801ad91f59.tar.gz
uscxml-72fb2cd0bd89eb40d4a96f86d464d9801ad91f59.tar.bz2
Got prolog datamodel to compile again
Diffstat (limited to 'src/uscxml/Interpreter.cpp')
-rw-r--r--src/uscxml/Interpreter.cpp72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index 7fe5cc1..b314d1a 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -471,78 +471,6 @@ void InterpreterImpl::processContentElement(const Arabica::DOM::Node<std::string
} else {
LOG(ERROR) << "content element does not specify any content.";
}
-
-#if 0
- try {
- std::string contentToProcess;
- if (HAS_ATTR(content, "expr")) {
- if (_dataModel) {
- /// this is out of spec
- contentToProcess = ATTR(content, "expr");
- // sendReq.data.atom = contentValue;
- // sendReq.data.type = Data::VERBATIM;
- } else {
- LOG(ERROR) << "content element has expr attribute but no datamodel is specified.";
- }
- } else if (content.hasChildNodes()) {
- bool presentAsDom = false;
- Node<std::string> contentChild = content.getFirstChild();
- while(contentChild) {
- if (contentChild.getNodeType() == Node_base::TEXT_NODE) {
- std::string trimmed = contentChild.getNodeValue();
- boost::trim(trimmed);
- if (trimmed.length() > 0)
- break;
- }
- if (contentChild.getNodeType() == Node_base::ELEMENT_NODE) {
- presentAsDom = true;
- break;
- }
- contentChild = contentChild.getNextSibling();
- }
-
- if (contentChild && presentAsDom) {
- // use the whole dom
- DOMImplementation<std::string> domFactory = Arabica::SimpleDOM::DOMImplementation<std::string>::getDOMImplementation();
- dom = domFactory.createDocument(contentChild.getNamespaceURI(), "", 0);
- Node<std::string> newNode = dom.importNode(contentChild, true);
- dom.appendChild(newNode);
- } else if (contentChild) {
- contentToProcess = contentChild.getNodeValue();
- } else {
- LOG(ERROR) << "content element has neither text nor element children.";
- }
- } else {
- LOG(ERROR) << "content element does not specify any content.";
- }
- if (contentToProcess.size() > 0) {
- /// try to interpret as JSON
- std::string trimmedContent = contentToProcess;
- boost::trim(trimmedContent);
- if (trimmedContent.find_first_of("{[") == 0) {
- data = Data::fromJSON(contentToProcess);
- if (data)
- return;
- }
- /// create space normalized string
- std::istringstream iss(contentToProcess);
- std::stringstream content;
- std::string seperator;
- do {
- std::string token;
- iss >> token;
- if (token.length() > 0) {
- content << seperator << token;
- seperator = " ";
- }
- } while (iss);
- text = content.str();
- }
- } catch (Event e) {
- e.name = "error.execution";
- receiveInternal(e);
- }
-#endif
}
void InterpreterImpl::processDOMorText(const Arabica::DOM::Node<std::string>& node,