Connecting Tech Pros Worldwide Forums | Help | Site Map

How can I retrieve HTML information from a CDATA Section of a XML file?

Member
 
Join Date: Sep 2009
Location: Sunvillage
Posts: 42
#1: Sep 12 '09
I have a XML file. In it I have a CDATA section for HTML Information. I need that Information in a browser.
Can any body help me to find out it.
My XML an HTML are in this format

Expand|Select|Wrap|Line Numbers
  1. <paragraph>
  2.           <position>1</position>
  3.           <title>Title</title>
  4.           <text>
  5.             <![CDATA[<p style="text-align: center;"><span style="color: #800000;"><span style="font-size: xx-large;">Wings of Pride </span></span><br /><br /><span style="color: #800000;">Adnan K&euml;r&ccedil;agu </span><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<span style="font-size: small;">Love is stronger than the fear&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;compassion is the true source of the tear <br />care for the one who is yours, for the one who is dear &nbsp;&nbsp; &nbsp;<br />there is nothing that&rsquo;s impossible to bear &nbsp;</span><br /><br /><span style="font-size: small;"><em><span style="color: #000080;">Special thanks for great support to my brother: Fatan K&euml;r&ccedil;agu</span></em></span></p>
  6. <p style="text-align: center;"><span style="font-size: small;"><em><span style="color: #000080;"><br /></span></em></span></p>]]>
  7.           </text>
  8.           <image_path></image_path>
  9.         </paragraph>
  10.  
  11.  
I want to retrive only the Html value in a browser how can I do it.

When I select The title node I need to retrive the HTML Information.
I have this information in a XmlNodelist by Xpath.
How can I do it?

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,658
#2: Sep 13 '09

re: How can I retrieve HTML information from a CDATA Section of a XML file?


why does it need to be CDATA it looks as though it’s a valid XML chunk, so there should be no problem using it directly.

and of course you should use it with its original namespace.

from the XML point of view its just a text node.
Reply


Similar XML bytes