473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CDATA vs character DATA

Are they teh same thing in xml 1.0?
Jul 20 '05 #1
2 1756
Jimmy zhang wrote:
Are they teh same thing in xml 1.0?


There are to different things called CDATA in XML 1.0:

CDATA Section: they are used to escape blocks of text containing
characters which would otherwise be recognized as markup. CDATA sections
begin with the string "<![CDATA[" and end with the string "]]>":]

CDATA Attribute Type: this is the string type of the three attribute
types in a DTD. For example:
<!ATTLIST termdef
name CDATA #IMPLIED>

Peter
Jul 20 '05 #2
Peter Gerstbach wrote:
Jimmy zhang wrote:
Are they teh same thing in xml 1.0?


There are to different things called CDATA in XML 1.0:

CDATA Section: they are used to escape blocks of text containing
characters which would otherwise be recognized as markup. CDATA sections
begin with the string "<![CDATA[" and end with the string "]]>":]

CDATA Attribute Type: this is the string type of the three attribute
types in a DTD. For example:
<!ATTLIST termdef
name CDATA #IMPLIED>


That doesn't answer the question, though.
The OP asked if CDATA and "character data" were the same thing.
No, they're not.

CDATA, as Peter rightly says, is an attribute type specifier.
It means your attribute can contain text or character entity
references, but not element markup, so if bar is declared as
a CDATA attribute on the element type foo,

<foo bar="blort"/>
and
<foo bar="bl&ocirc;rt"/>

are well-formed, but

<foo bar="blo<br/>rt">

is not.

Character Data is the generic term for the text content of a document.
It's what gets parsed to see if it contains any [more] markup (whence
the term Parsed Character Data or PCDATA). The term is more commonly
used to mean "unmarked text".

///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John van Terheijden | last post by:
Hi. I'm trying to develop a program that uses XML files store data. I'm using Windows XP, Apache 1.3.29 and PHP 4.3.4. Right now the XML file is read using the xml_parser_create(),...
3
by: wenke | last post by:
Hi, I am using the following code (see below) from php.net (http://www.php.net/manual/en/ref.xml.php, example 1) to parse an XML file (encoded in UTF-8). I changed the code slightly so that the...
2
by: nowhere | last post by:
Hi, I need to preserve some ASCII control characters (CR and LF) within an XML file so I have included the data in a CDATA section. However, when parsing it using expat, I lose the CR...
4
by: sunil | last post by:
I am creating a XML document which opens fine in IE. Implies MSXML thinks it is a well formed document. But when I try to load this document in VB.net using the following code Dim doc As New...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
11
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new XmlDocument(); docNav.LoadXml(xmlString);...
12
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> ...
2
by: Spacen Jasset | last post by:
I've read the XML standard, and I wonder if someone can confirm this for me. Am I right in thinking that line endings are translated even within CDATA sections? The standard states that...
18
by: sim.sim | last post by:
Hi all. i'm faced to trouble using minidom: #i have a string (xml) within CDATA section, and the section includes "\r\n": iInStr = '<?xml version="1.0"?>\n<Data><!]></Data>\n' #After i...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.