summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xplist.c7
-rw-r--r--test/data/1.plist2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 15c9497..ce8dec1 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -196,7 +196,12 @@ static void node_to_xml(GNode * node, gpointer xml_struct)
196 { 196 {
197 xmlNodeAddContent(xstruct->xml, BAD_CAST("\t")); 197 xmlNodeAddContent(xstruct->xml, BAD_CAST("\t"));
198 } 198 }
199 child_node = xmlNewChild(xstruct->xml, NULL, tag, BAD_CAST(val)); 199 if (node_data->type == PLIST_STRING) {
200 /* make sure we convert the following predefined xml entities */
201 /* < = &lt; > = &gt; ' = &apos; " = &quot; & = &amp; */
202 child_node = xmlNewTextChild(xstruct->xml, NULL, tag, BAD_CAST(val));
203 } else
204 child_node = xmlNewChild(xstruct->xml, NULL, tag, BAD_CAST(val));
200 xmlNodeAddContent(xstruct->xml, BAD_CAST("\n")); 205 xmlNodeAddContent(xstruct->xml, BAD_CAST("\n"));
201 g_free(val); 206 g_free(val);
202 207
diff --git a/test/data/1.plist b/test/data/1.plist
index dfa27b0..c7135e9 100644
--- a/test/data/1.plist
+++ b/test/data/1.plist
@@ -29,5 +29,7 @@
29 <key>Some Data</key> 29 <key>Some Data</key>
30 <data> 30 <data>
31 </data> 31 </data>
32 <key>Some Entities</key>
33 <string>hellow world &amp; others &lt;nodes&gt; are &quot;fun!?&apos;</string>
32</dict> 34</dict>
33</plist> 35</plist>