From d4a3656be015c3d36a61aa1de57b2954e734b1ce Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 16 May 2005 16:05:59 +0000 Subject: [PATCH] creating text nodes differently now for proper escaping... git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@311 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libtransport/transport_message.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libtransport/transport_message.c b/src/libtransport/transport_message.c index 4517a84..5650744 100644 --- a/src/libtransport/transport_message.c +++ b/src/libtransport/transport_message.c @@ -280,17 +280,26 @@ char* message_to_xml( const transport_message* msg ) { char* thread = msg->thread; if( thread && strlen(thread) > 0 ) { - thread_node = xmlNewChild(message_node, NULL, (xmlChar*) "thread", (xmlChar*) thread ); - xmlAddChild( message_node, thread_node ); + thread_node = xmlNewChild(message_node, NULL, (xmlChar*) "thread", NULL ); +// xmlNewTextChild(thread_node, NULL, NULL, ); + xmlNodePtr txt = xmlNewText((xmlChar*) thread); + xmlAddChild(thread_node, txt); + xmlAddChild(message_node, thread_node); } if( subject && strlen(subject) > 0 ) { - subject_node = xmlNewChild(message_node, NULL, (xmlChar*) "subject", (xmlChar*) subject ); + subject_node = xmlNewChild(message_node, NULL, (xmlChar*) "subject", NULL ); + //xmlNewTextChild(subject_node, NULL, NULL, (xmlChar*) subject ); + xmlNodePtr txt = xmlNewText((xmlChar*) subject); + xmlAddChild(subject_node, txt); xmlAddChild( message_node, subject_node ); } if( body && strlen(body) > 0 ) { - body_node = xmlNewChild(message_node, NULL, (xmlChar*) "body", (xmlChar*) body ); + body_node = xmlNewChild(message_node, NULL, (xmlChar*) "body", NULL); + //xmlNewTextChild(body_node, NULL, NULL, (xmlChar*) body ); + xmlNodePtr txt = xmlNewText((xmlChar*) body); + xmlAddChild(body_node, txt); xmlAddChild( message_node, body_node ); } -- 2.11.0