Questions tagged [cdata]

CDATA (literally, character data) is data that will not be parsed as markup in XML and SGML documents.

While technically "all text that is not markup constitutes the character data" of an XML document (and a similar definition applies for SGML), the term CDATA is typically used in the context of CDATA sections.

A CDATA section begins with the string <![CDATA[ and ends with the string ]]>. The data inside a CDATA section is not parsed as markup within an XML or SGML document - which can be useful when representing XML or SGML within an XML or SGML document:

<![CDATA[
  <html>
    <head>
      <title>This is not markup ...</title>
    </head>
    <body>
      <p>... and neither is this.</p>
    </body>
  </html>
]]>

A CDATA section may contain any sequence of characters except for the string ]]> (which would terminate the section). One way to work around this limitation is to terminate the CDATA section after the string ]] and then begin a new one immediately, starting with the final >. For instance,

<![CDATA[How to represent ']]]]><![CDATA[>' inside a CDATA section.]]>

is equivalent to

How to represent ']]>' inside a CDATA section.
1111 questions
5
votes
1 answer

How to Include an unparsed external entity value in a XML?

I have an xml syntax error with this example : ]> &rules; where data.txt contains : 1 <15024 2 >15023 But of course I…
Xorax
  • 1,644
  • 2
  • 18
  • 18
5
votes
4 answers

How to parse an XML DOM inside a CDATA element in XSLT?

say I have an XML file like: Sci-fi2]]> Some Book Some author Another Book …
Chinmoy
  • 1,750
  • 2
  • 21
  • 45
4
votes
1 answer

manipulate marshaller in jax-ws

is there a way to manipulate the marshaller used in jaxws. I like to send a cdata filed in a webservice request and for this i want to try something like describet here: http://odedpeer.blogspot.de/2010/07/jaxb-sun-and-how-to-marshal-cdata.html in…
Oliver Dalley
  • 101
  • 1
  • 4
4
votes
2 answers

Stop WordPress from enclosing script in CDATA

I am importing HTML pages using HTML import plugin for WordPress. I have a code snippet for google maps, which is imported. However, after import, it encloses the script tag in CDATA. If I remove CDATA, the map works fine. How do I stop WordPress…
user1009059
  • 75
  • 1
  • 3
4
votes
1 answer

powershell parsing of cdata-section

I'm trying to read an rss feed using powershell and I can't extract a cdata-section within the feed Here's a snippet of the feed (with a few items cut to save space):
user1070524
  • 43
  • 1
  • 3
4
votes
6 answers

Regex to parse out html from CDATA with C#

I would like to parse out any HTML data that is returned wrapped in CDATA. As an example Approved]]> Thanks!
4
votes
1 answer

Delphi and XML CDATA

How can I extract CData from a XML file with Delphi ? this is my XML file: