473,322 Members | 1,781 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,322 software developers and data experts.

CDATA and PCDATA

I know one can define
CDATA text by

<![CDATA[<bla> &bla;]]>

which is the same as PCDATA:

&lt;bla&gt; &amp;bla;

But if you define an attribute in a DTD
to be CDATA or PCDATA, isnt it the same value space
since both CDATA and PCDATA are equivalent?
And: everywhere where PCDATA is allowed, CDATA sections are allowed, too,
so what makes the difference if you define the value type of
an attribute as CDATA or PCDATA?
THANKS
Jul 20 '05 #1
2 6925
"indo3" <in****@gmx.de> wrote in message
news:ca**************************@posting.google.c om...

--snip--
so what makes the difference if you define the value type of
an attribute as CDATA or PCDATA?


An attribute cannot be of type PCDATA (see
http://www.w3.org/TR/REC-xml/#sec-attribute-types).
// Magnus
Jul 20 '05 #2
In article <ca**************************@posting.google.com >,
indo3 <in****@gmx.de> wrote:
But if you define an attribute in a DTD
to be CDATA or PCDATA, isnt it the same value space
since both CDATA and PCDATA are equivalent?


But you *can't* define an attribute to be of type PCDATA!

In any case I think it's a mistake to look for a consistent
interpretation of the term "CDATA" in XML. As an attribute type it
means, roughly, plain text; in content it's just part of the
<![CDATA[...]]> construct. The more general "marked sections" of SGML
are not available in XML so its significance is lost.

The "P" in PCDATA stands for parsed, and that fits with the fact that
"<" is significant in PCDATA and not CDATA, but "&" is significant
in CDATA attributes but not in CDATA sections.

-- Richard
Jul 20 '05 #3

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

Similar topics

2
by: Jimmy zhang | last post by:
Are they teh same thing in xml 1.0?
2
by: Larry | last post by:
Hi guys, I'm having trouble with the following code: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE db > <db> <title>"%%&&&hello!!!"</title>
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);...
3
by: Bob | last post by:
Hi, Version 2.0 CLR How can I detect a #PCDATA element in an incoming stream? I have tried using XmlReader xr = XmlReader.Create(streamResponse); while (xr.Read()) ...
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 //<!]> ...
7
by: Max | last post by:
Hello everyone! Can anyone help me to convert the CDATA expression "CDATA ::= (Char* - (Char* ']]>' Char*)" to Javascript Regular Expression? Thanks, Max
3
by: Kenny | last post by:
Hey, Is there some way to CDATA an element in an XSD? I'm having an incredibly hard time finding a solution. -Kenny
9
by: shapper | last post by:
Hello, Why do some pages I have seen have //<![CDATA[ in the beginning of a script tag before the script itself? Do I need this? Thanks, Miguel
6
by: dkyadav80 | last post by:
Hi sir, I'm new about xml, javascript. I have two selection field(html) first is city and second is state. the city and state values should be store in xml file. when user select city then all...
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...
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)...
1
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.