From 1f2286ffefd354e6a88d0d84fccf35fd72d4339b Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 15 Feb 2015 18:17:53 +0100 Subject: removed enquoting from primitive string content in XML output. --- src/plugins/xml/XmlOutput.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/plugins/xml') 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 XmlTransformer::transformPrimitive(Handle 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{new Text(mgr, parent, textcontent)}; return text; } } -} \ No newline at end of file +} -- cgit v1.2.3