cdata

how to see inside CDATA?

how to see what is inside [CDATA[I3NpZGUtYmFyIHVsIGxpIGhyLnNlcGFyYXRvciB7DQogICBoZWlnaHQ6IDAuNWVtOw0KICAgY29sb3I6IGJsYWNrOw0KICAgd2lkdGg6IDEwMCU7DQp9DQoNCmxpLnNlY3Rpb25oZWFkZXINCnsNCiAgdGV4dC1hbGlnbjogY2VudGVyOw0KICBmb250LXNpemU6IG1lZGl1bTsNCiAgYm9yZGVyLXRvcDogMnB4IGRvdWJsZSByZ2IoMTUzLDE1MywxNTMpOw0KICBib3JkZXItYm90dG9tOiAxcHggc29saWQg...

Regex to parse out html from CDATA with C#

Hi I would like to parse out any HTML data that is returned wrapped in CDATA. As an example <![CDATA[<table><tr><td>Approved</td></tr></table>]]> Thanks! ...

what actually is PCDATA and CDATA?

it seems that a loose definition of PCDATA and CDATA is that 1) PCDATA is character data, but is to be parsed. 2) CDATA is character data, and is not to be parsed. but then someone told me that CDATA is actually parsed or PCDATA is actually not parsed... so it is a bit of a confusion. Does anyone know the real deal is? Update: I act...

How do I update text inside CDATA

I want to replace text inside cdata section but when I simply trying to add text to it I lose CDATA definition. I have a XML like this: <title><![CDATA[string]]></title> When I try to update this field with new value: myXmlNode.SelectSingleNode("title").InnerText = TextBoxName.Text; Output is <title>string</title> How do can I...

Is there any use for putting a string that contains enters (char 10 or 13) in a xml CDATA section?

I'm currently working on some old code that has the following construct. Document doc = org.w3c.Document Element root = doc.getDocumentElement(); if ( string contains \n or \r ) then root.appendChild(doc.createCDATASection(string)) else root.appendChild(doc.createTextNode(string)) endif I can not think of any usage that would nee...

C#: byte array in xml CData

Hi all, I have a WCF service that is returning a block of xml. One element is a CData[] section. My application reads an HTML file out of the database and converts it to a PDF byte[] array using ABCPDF. Then in my XmlWriter Im adding the bytes to the CData section. The problem is the resulting xml looks like this: <![CDATA[System.B...

When to CDATA vs. Escape & Vice Versa?

I'm creating XML documents with values fetched from a DB. Occasionally due to a legacy implementation, I'll pullback a value that contains a char that's invalid when not properly escaped (& for example). So the question becomes, should I CDATA or Escape? Are certain situations more appropriate for one vs. the other? Examples: <Email>f...

XML CDATA Encoding

I am trying to build an XML document in C# with CDATA to hold the text inside an element. For example.. <email> <![CDATA[[email protected]]]> </email> However, when I get the InnerXml property of the document, the CDATA has been reformatted so the InnerXml string looks like the below which fails. <email> &lt;![CDATA[[email protected]]]&gt; <...

jQuery CDATA parsing

Hey, solution (stupid!): The XML wasn't valid.. I forgot a /. Although I validated it earlier in w3schools, I added one tag and didn't close it properly. original: I'm parsing an xml file with jQuery. In one node I store a JavaScript function with CDATA: <action is="javascript"><![CDATA[ alert("Holy Crap!"); ]]> </action> now I craw...

Using NSXMLParser with CDATA

I'm parsing an RSS feed with NSXMLParser and it's working fine for the title and other strings but one of the elements is an image thats like <!CDATA <a href="http:image..etc> How do I add that as my cell image in my table view? Would I define that as an image type? This is what i'm using to do my parsing: - (void)parser:(NSXMLPars...

How to preserve newlines in CDATA when generating XML?

Hello, I want to write some text that contains whitespace characters such as newline and tab into an xml file so I use Element element = xmldoc.createElement("TestElement"); element.appendChild(xmldoc.createCDATASection(somestring)); but when I read this back in using Node vs = xmldoc.getElementsByTagName("TestElement").item(0); Str...

Decode CDATA section in C#

I have a bit of XML as follows: <section> <description> <![CDATA[ This is a "description" that I have formatted ]]> </description> </section> I'm accessing it using curXmlNode.SelectSingleNode("description").InnerText but the value returns \r\n This is a "description"\r\n that I have formatted instead...

E4X Add CDATA content

Basically I need to define a node name and its CDATA content using variables. var nodeName:String = "tag"; var nodeValue:String = "<non-escaped-content>"; Naively I thought this would work : var xml:XML = <doc><{nodeName}><![CDATA[{nodeValue}]]></{nodeName}> Outputs : <doc><tag><![CDATA[{nodeValue}]]></tag></doc> In a previous v...

How to read CDATA in XML file with PowerShell?

I am having a difficult time reading an XML file with Cdata inside. in $xmlsource <list> <topic> <topicTitle>Test</topicTitle> <topicDetail><![CDATA[<br>randomHTMLhere</br>]]></topicDetail> </topic> </list> powershell [xml]$xml = get-content $xmlsource foreach ($topic in $xml.list) { $topic.topicTitle $top...

Asp.net XMLwriter CData Escape Characters

I use ASP.net VB.net to write a XML file. In one of the element which is called "Description" i have to add a "<![CData[Class : <b>Class Name</b><br>Price: 100,000.00]]>". Using, strDes = "<![CDATA[Class : <b>" + myReader.GetSqlValue(4).ToString + "</b><br>Price: " + myReader.GetSqlValue(7).ToString + "]]>" XMLwrite.WriteElementS...

How do I put CDATA on Yahoo! Pipes?

I've generated a feed from GameTraillers.com for my favorite show there — ScrewAttack. But the embed option doesn't show up on Google Reader because the embedded video is in another castle tag: item.exInfo:fileType.embedcode. I've managed to find the tag where the embed code is, removed the "<![CDATA[" and "]]$gt;" from that tag with Re...

XML Serialization - XmlCDataSection as Serialization.XmlText

I am having problems serializing a cdata section using c# I need to serialize XmlCDataSection object property as the innertext of the element. The result I am looking for is this: <Test value2="Another Test"> <![CDATA[<p>hello world</p>]]> </Test> To produce this, I am using this object: public class Test { [System.Xml.Serial...

SQL Server XML output with CDATA

Is there a way to have an SQL Server XML return use CDATA? I have XML being returned by SQL Server like this: <locations> <site id="124"> <sitename>Texas A &amp; M</sitename> </site> </locations> When I am required to have this: <locations> <site id="124"> <sitename><![CDATA[Texas A & M]]></sitename> <...

Transform XML with XSLT and preserve CDATA (in Ruby)

I am trying to convert a document with content like the following into another document, leaving the CDATA exactly as it was in the first document, but I haven't figured out how to preserve the CDATA with XSLT. Initial XML: <node> <subNode> <![CDATA[ HI THERE ]]> </subNode> <subNode> <![CDATA[ SOME TEXT ]]> ...

XML Serialization of HTML

Okay this one DID it! Thanks to all of you! public class Result { public String htmlEscaped { set; get; } [XmlIgnore] public String htmlValue { set; get; } [XmlElement("htmlValue")] public XmlCDataSection htmlValueCData { get { XmlDocument _dummyDoc = new ...