summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-15 18:17:53 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-15 18:17:53 +0100
commit1f2286ffefd354e6a88d0d84fccf35fd72d4339b (patch)
tree68d2ac223892133be083995edc64e99ab49f9f14 /src
parent0d8da1277274ef1b79b48df47e4dbc070f543d33 (diff)
removed enquoting from primitive string content in XML output.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/xml/XmlOutput.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/xml/XmlOutput.cpp b/src/plugins/xml/XmlOutput.cpp
index 00aae04..68edc0e 100644
--- a/src/plugins/xml/XmlOutput.cpp
+++ b/src/plugins/xml/XmlOutput.cpp
@@ -107,10 +107,18 @@ Rooted<Text> XmlTransformer::transformPrimitive(Handle<Element> parent,
{
Manager &mgr = parent->getManager();
// transform the primitive content.
+ Variant v = p->getContent();
std::string textcontent =
VariantWriter::writeJsonToString(p->getContent(), pretty);
+ if (v.isString() && ((textcontent[0] == '\"' &&
+ textcontent[textcontent.size() - 1] == '\"') ||
+ (textcontent[0] == '\'' &&
+ textcontent[textcontent.size() - 1] == '\''))) {
+ // cut the start and end quote
+ textcontent = textcontent.substr(1, textcontent.size() - 2);
+ }
Rooted<Text> text{new Text(mgr, parent, textcontent)};
return text;
}
}
-} \ No newline at end of file
+}