cdata

Outputting CDATA in XQuery

How would I, using XQuery, transform <author>John Smith</author> to <author><![CDATA[John Smith]]></author> ? Also, how would I transform <content>&lt;p&gt;&lt;em&gt;Hello&lt;/em&gt;&lt;/p&gt;</content> to <content><![CDATA[<p><em>Hello</em></p>]]></content> ? If it matters, I am using XSLPalette.app. ...

How can I split an <xsl:foreach> into multiple parts?

I have a list of elements that I want to split into individual lists of 3. The end result would be something like this: <ul> <li>element</li> <li>element</li> </ul> <ul> <li>element</li> <li>element</li> </ul> <ul> <li>element</li> <li>element</li> </ul> My XSLT is like this, but it doesn't work, because I can...

EMPTY CDATA in XML

<body><![CDATA[]]></body> or <body></body> Is there a difference or downside to each? Do I need to do anything while parsing the XML? What do you prefer? ...

HTML inside XML doc doesn't display properly if first text inside element

I'm using javascript to pull data returned from an XML document. Inside this XML file are elements that may have XHTML tags inside of them. The nodevalue is not displaying when the XHTML is surrounded by CDATA tags nor when I enter &lt/&gt manually. When there is no XHTML formatting inside an element, the nodevalue displays fine. <note ...

cdata in xslt for html

I have an XSLT file generating plain HTML. I need to wrap some elements in CDATA blocks, so intend to use cdata-section-elements. But, if the element I want to have contain CDATA is only one <p> on the page, how do I get it to not put CDATA in all the other <p> elements? The input data is this: <item> ... <g:category>Gifts under &a...

Help with XML, PHP and CDATA

Hi, I have the following contents in my XML file: <items> <item id="1"><content><![CDATA[<p>string</p>]]></content></item> </items> I have HTML inside the content, so, I used CDATA. However, when I'm trying to display the content as HTML on the web page: $item_content = $xpath2->query("/bulletin/item[@id='$item_id']/content"); forea...

PHP, XML to HTML through XSLT makes HTML inside CDATA encoded.

Hi, I really need an answer to this question. I am working on a project which uses XML to make pages, then XSLT to produce it to a web page. Here is a code sample: public function transform ($xml) { $proc = new XSLTProcessor; $proc->importStyleSheet ($this->xsl); $output = $proc->transformToXML ($xml); return $output; } the...

What is the reason that CDATA even exists?

I often see people asking XML/XSLT related questions here that root in the inability to grasp how CDATA works (like this one). I wonder - why does it exist in the first place? It's not that XML could not do without it, everything you can put into a CDATA section can be expressed as "native" (XML-escaped). I appreciate that CDATA potent...

Reading RSS feed with Linq-to-XML and C# - how to decode CDATA section?

Hi there, I am trying to read an RSS feed using C# and Linq to XML. The feed is encoded in utf-8 (see http://pc03224.kr.hsnr.de/infosys/feed/) and reading it out generally works fine except for the description node because it is enclosed in a CDATA section. For some reason I can't see the CDATA tag in the debugger after reading out th...

Using CDATA element in XML is vulnerable or not?

Is it a vulnerable using CDATA element in XML documents? If so what happens if we use CDATA element in XML documents? ...

read cdata in xml from javascript

<![CDATA[test]]> I am getting blanks. var dataNode=Ext.DomQuery.selectNode('data',xml); console.log(dataNode.childNodes[0].nodeValue); console.log(dataNode.nodeValue); ...

how to extract data from CDATA

Hi, I am extracting data from an XML and some tags have data inside CDATA in this way <description><![CDATA[Changes (as compared to 8.17) include: Features: * Added a &#8216;Schema Optimizer&#8217; feature. Based on &#8220;procedure analyse()&#8221; it will propose alterations to data types for a table based on analysis on what dat...

Mixing childs with cdata under the same node. Is it valid?

Hi, I need to parse the following xml document (which is coming from external web service): ... <dati> <Riconoscimento> <IdentificativoPosizione>xxxx</IdentificativoPosizione> <OutputRestituiti>xxx</OutputRestituiti> </Riconoscimento> <![CDATA[text text text]]> </dati> ... The problem is that until ther...

Does javadoc have an equivalent to <![CDATA[ ... ]]> ?

Unfortunately, there is no CDATA in HTML. This is a pity, because it would be perfect for adding javadoc comments that include XML, so you don't have to escape the < and >, for example: /**<![CDATA[ This parses <complexType name=""> ]]>*/ However, it would be possible for javadoc to recognize the CDATA section, and convert it to HTML...

How can I extract a CDATA value from the structure created by XML::Simple?

I use a Perl script with the module XML:Simple to parse an XML feed: my $xml=XMLin($resp->content); my $xml2 = $xml->{params}{param}{value}{array}{data}{value}{struct}{member}; print $xml2->{prod_id}{value}{int}; #works fine print $xml2->{product_text}{value}{string}; #returns a hash reference (hash(0x...) What have I to modify to ...

how can i grab CData out of BeatuifulSoup

I have a website that I'm scraping that has a similar structure the following. I'd like to be able to grab the info out of the CData block. I'm using BeautifulSoup to pull other info off the page, so if the solution can work with that, it would help keep my learning curve down as I'm a python novice. Specifically, I want to get at the ...

Safari not display CDATA - JS alert is blank

Hi, I've been developing an app which pulls in an XML file using Jquery. Everything is working well in all browsers but I noticed that the Safari is not picking up my CDATA value. When I alert the value its empty. I am using this code : $('flight',xml).each(function(i) { deeplink = $(this).find("deeplink").text(); alert(deeplink); ...

How do I create an extra RSS item element that contains HTML using PyRSS2Gen?

I'm using PyRSS2Gen to generate an RSS feed. I've succeeded in extending it to add an extra element to each item in the RSS feed: class FullRSSItem(PyRSS2Gen.RSSItem): def __init__(self, **kwargs): if 'content' in kwargs: self.content = kwargs['content'] del kwargs['content'] else: ...

Convert an xml element whose content is inside CDATA

I have a xml fragment like below <Detail uid="6"> <![CDATA[ <div class="heading">welcome to my page</div> <div class="paragraph">this is paraph</div> ]]> </Detail> and I want to be able to change the <div class="heading">...</div> to <h1>Welcome to my page</h1> <div class="paragraph">...</div> to <p>this is paragrap...

Ignore CDATA while xml parsing

I am new to iphone development.I want to ignore CDATA tag while parsing because it consider the HTML tag following it as text.Since i want to display the content alone ,i want my parser to ignore CDATA tag.My source code is [CDATA[<br /><p class="author"><span class="by">By: </span>By Sydney Ember</p><br><p>In the week since an </p>]]. ...