OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] parsing xml strings that consists of special characters

[ Lists Home | Date Index | Thread Index ]

You should either enclose the special characters in CDATA, or represent them as entity/character references, but not both.
 
But I'm puzzled by this:
 
var conten=<![CDATA[ " &lt;
 
This looks like a variable assignment in some scripting language appearing within an XML document (perhaps). I suspect the problems are to do with mixing languages and escape conventions, so you need to explain your environment better.
 
Incidentally, saying that something "didn't work" is never helpful. What was the output and how did it differ from expectations? You might not understand the error message, but your purpose in posting is to reach people who do understand it.
 
Michael Kay
 


From: Robina Brintha [mailto:robina.brintha@gmail.com]
Sent: 19 August 2005 11:31
To: xml-dev@lists.xml.org
Subject: [xml-dev] parsing xml strings that consists of special characters


Hello everybody,
 
I have a question about parsing xml strings that have special characters such as <,>,& .I need to send some <html> tag elements as an xml string in a soap request .I tried replacing < with &lt; and > with &gt; and embedding this inside <![[CDATA ]]> but it didnt work  
 
 
<html><head></head><body><h1>Test</h1><h3>foo</h3></body></html> this is the content I want to send as a xml string .
 
And I send in the following way,
var conten=<![CDATA[ " &lt; html &gt; &lt; head &gt; &lt; /head &gt; &lt; body &gt; &lt; h1 &gt; Test &lt; /h1 &gt;&lt;h3&gt; foo &lt; /h3 &gt; &lt; /body &gt; &lt; /html &gt; "]]>;
 
which is sent as,
<content>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Test&lt;/h1&gt;&lt;h3&gt;foo</h3&gt;&lt;/body&gt;&lt;/html&gt;</content> in the soap request message.
 
can anyone tell me what's my mistake and how can I rectify it?I would be of great help to me.Thanks in advance.
 
regards,
Robina
Master of Media Informatics
(RWTH univ)
Bonn
Germany
 





Robina
Master of Media Informatics
(RWTH univ)
Bonn
Germany




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS