summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/invoker/xhtml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-03 12:10:57 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-03 12:10:57 (GMT)
commit6e1a4a67d5b17e92135cd3f5daf51bf044d76e40 (patch)
tree63d8de9a5ba99dbcd16c6bd867241a7e7466c559 /src/uscxml/plugins/invoker/xhtml
parent37f8735a66aadd0e3f019f5edbb9356cf4a7b974 (diff)
downloaduscxml-6e1a4a67d5b17e92135cd3f5daf51bf044d76e40.zip
uscxml-6e1a4a67d5b17e92135cd3f5daf51bf044d76e40.tar.gz
uscxml-6e1a4a67d5b17e92135cd3f5daf51bf044d76e40.tar.bz2
Got rid of more dynamic_casts
Diffstat (limited to 'src/uscxml/plugins/invoker/xhtml')
-rw-r--r--src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp
index 5b67f7c..285db72 100644
--- a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp
+++ b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp
@@ -186,11 +186,12 @@ void XHTMLInvoker::reply(const SendRequest& req, const HTTPServer::Request& long
std::stringstream ss;
// Arabica::DOM::Node<std::string> content = req.dom.getDocumentElement();
Arabica::DOM::Node<std::string> content = req.dom;
- if (content && iequals(content.getLocalName(), "content")) {
- reply.headers["X-SCXML-Type"] = (HAS_ATTR(content, "type") ? ATTR(content, "type") : "replacechildren");
- reply.headers["X-SCXML-XPath"] = (HAS_ATTR(content, "xpath") ? ATTR(content, "xpath") : "/html/body");
- if (HAS_ATTR(content, "attr"))
- reply.headers["X-SCXML-Attr"] = ATTR(content, "attr");
+ if (content && content.getNodeType() == Arabica::DOM::Node_base::ELEMENT_NODE && iequals(content.getLocalName(), "content")) {
+ Arabica::DOM::Element<std::string> contentElem = Arabica::DOM::Element<std::string>(content);
+ reply.headers["X-SCXML-Type"] = (HAS_ATTR(contentElem, "type") ? ATTR(contentElem, "type") : "replacechildren");
+ reply.headers["X-SCXML-XPath"] = (HAS_ATTR(contentElem, "xpath") ? ATTR(contentElem, "xpath") : "/html/body");
+ if (HAS_ATTR(contentElem, "attr"))
+ reply.headers["X-SCXML-Attr"] = ATTR(contentElem, "attr");
}
// ss << req.getFirstDOMElement();
ss << req.dom;