cdata

SimpleXML -- Strip CDATA Tags (or embed HTML markup in XML)

I've just recently begun learning XML in the context of PHP and Javascript, and I've encountered a problem. Here's the XML I'm using: http://www.dkarndtcpa.net/new_site/faq.xml (I still can't figure out how to show the code in this little box here...) So the issue is I want to put HTML markup within the XML, and then be able to extrac...

How to get CDATA content into UIWebView in iPhone SDK?

Hi Guys, I am not understanding how to get the content of CDATA, I NSString* htmlString = [self getnerateFormattedString:details]; [webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.myWebsite.com"]]; -(NSString*) getnerateFormattedString:(TrackDetails*) details { NSString* htmlString = @""; htmlStri...

xsl:cdata elements inside xsl:element

I am trying to get the following output : <name><![CDATA[ SomeNameHere ]]></name> using the following xslt : <xsl:element name="name"> <xsl:cdata> <xsl:value-of select="name"/> </xsl:cdata> </xsl:element> But while compiling I get the following exception : 'xsl:cdata' cannot be a child...

Markdown within yaml / yaml multi-line escape sequence?

Is it possible to store unescaped markdown documents in yaml? I've tested key:|+ markdown text block that could have any combination of line breaks, >, -, :, ', " etc etc. This does not work. I need something like CDATA or python style triple-quotes for yamal. Any ideas? ...

Xslt produce some <name> tags with CDATA and some <name> tags without?

Summary: I'm using xslt to convert data, and need to produce some tags with CDATA inside and some tags without. Is escaping the CDATA sections my only option? I'm attempting to convert data I already have in xml to Moodle Xml for importing. The final product needs to include some Html, which the Moodle Xml doc specifically says needs ...

Removing CDATA from XML/RSS feed using jQuery

Ok So I looked at this: http://stackoverflow.com/questions/2308889/using-jquery-to-extract-cdata-in-xml-for-use-as-html-content But it didn't help with what I'm doing. I'm getting an rss/xml feed from a url. I'm having an issue with the CDATA in the title and description tag. Here's the feed item: <item> <title><![CDATA[Impact Sou...

php simplexml - extract large number on cdata

I have the following part of my xml: <book number="AB 123" type="SCI"> <info> <type code="FIC"><![CDATA[Fiction]]></status> <publish-time><![CDATA[20090110214000]]></publish-time> </info> </book> If i do: echo $key->info->type; I get nice and easy "Fiction" BUT if i do: echo $key->info->publish-time; I get "0". I thought i has to do ...

Extracting data from CDATA using LINQ to XML

I have the following xml file and I am trying to use linq to xml to get the Elements which are residing inside the CDATA section. Any suggestions please. <?xml version = "1.0" encoding = "UTF-8"?> <result final = "true" transaction-id="84WO" xmlns="http://cp.com/rules/client"&gt; <client id = "CustName'> <quoteback> </client> <report fo...

Parse CDATA content in Ruby on Rails

Hi, I am new to rails. Could you help me with a good tutorial on how to parse CDATA content in ruby on rails. I have learnt to use Feed-zirra to parse the content but I am not able to parse content from the websites which use CDATA. If it is not possible to do it with feed-zirra could you help me with alternatives. Looking forward f...

How to read XML CDATA with SAS

I have XML files containing multidimensional arrays of numeric data and I need to read them into SAS. To make files smaller, the format has been specified so that the data are stored in an one-dimensional CDATA array. To get an idea of the structure of the files, consider something like this: <!-- Metadata --> <table name=foo> <axis i...

Delphi, soap and wrapping values in cdata

Hi, We have imported a wsdl from a thirdparty. This gives us a set of interfaces with methods to call, and classes for parameters and returnvalues. Now, the thirdparty have told us that one of the widestring values that we pass has to be wrapped in a CData-section. In Delphi 2007, is there a way of controlling how a given property is ...

Content inside CDATA is not displayed properly when processed through JavaScript

I have an XML document with some sample content like this: <someTag> <![CDATA[Hello World]]> </someTag> I'm parsing the above XML in JavaScript. When I try access and render the Hello World text using xmldoc.getElementsByTagName("someTag")[0].childNodes[0].textContent all I get was a blank text on screen. The code is not returning ...

What exactly is CDATA and what does it do?

I sometimes notice a CSS or JS code surrounded with <![CDATA[ and ]]> tags. I couldn't find any explanation to this. What does CDATA do? Why is it used by some people and what is it needed for? ...

Cretion CDATA section confusing

Trying o create CDATA section withing description field, code is pretty simple in resulting XML CDATA section does not appear!! Node de = document.createElement("description"); de.appendChild(document.createCDATASection(reportData.getIssue().getDescription() + "more]]>data")); e.appendChild(de); In result XML getting: <description>Ro...

Error in formating of XML string with CDATA

I get this error "Start tag on line 1 does not match the end tag of 'document'". string rawXml = "<?xml version='1.0' ?>" + "<document>" + "<![CDATA[" + "<topic>" + "My test" + "</topic>" + "]]>" + "</document>"; Error occurres when I try to...

Removing content from a xml file

I have a xml file <?xml version="1.0" encoding="UTF-8"?> <text><![CDATA[<p><span style="font-family: arial black,avant garde; font-size: medium;"><strong>Extensible Markup Language</strong> (<strong>XML</strong>)</span> ]]></text> How i can replace <![CDATA[ and ]]> using php ...

Can anybody explain about Movie function and cdata in MATLAB?

Hi. I'm trying to figure out how to use cdata under Movie function in MATLAB. Can any expert please give me a short explanation? Thank you! ...

Is CDATA supposed to be URL-encoded?

Obviously the answer is no... right? The reason I ask is because I have this string defined in XML for an Android app: <string name="foo"><![CDATA[<html><body><p>This%20is%20a%20test</p></body></html>]]></string> All I do to the string is read it, and display in an HTML view. I would not have expected the %20s to be interpreted, yet t...

How to create PHP/JSP/ERB tags using XSLT?

I have a bunch of XML files which I use to generate HTML pages. Those pages ultimately get marked up (by hand) with some <%= %> tags and made into Ruby .erb templates. Is there a way to generate the special tags <?php ?> or <%= %> directly during the XSL transform? I've tried using a <![CDATA[ ... ]]> block, but then the output generat...

In Java, how to print an XML document using escaped text instead of CDATA sections?

Hi. Can I print an XML document using escaped text instead of CDATA sections? For example, I want the output string as &lt;sender&gt;John Smith&lt;/sender&gt; instead of <![CDATA[<sender>John Smith</sender>]]>. UPDATE: I know an XML document can be represented in both ways without any sematic difference, but I want to print the output st...