diff options
Diffstat (limited to 'src/uscxml/Interpreter.cpp')
-rw-r--r-- | src/uscxml/Interpreter.cpp | 72 |
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, |