[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: PCDATA and CDATA

  • From: Mike Brown <mike@s...>
  • To: xml-dev@l...
  • Date: Sat, 15 Sep 2001 18:31:26 -0600 (MDT)

pcdata cdata
Michael Fitzgerald wrote:
> #PCDATA [...] specifies that an element will contain parsed
> character data. Parsing tests whether the characters conform to the
> lexical constraints imposed by XML 1.0. 
> 
> CDATA appears in attribute declarations and specifies that an
> attribute will contain character data that is not parsed.

That's not accurate. All characters in an XML document are "parsed" in
the sense that you describe.

"CDATA" is a token used in an attribute declaration to declare the
attribute as having a string type. '&', and '<' and the quote character
used for delimiting the attribute value have special meaning in
attributes of this type.

"#PCDATA" is a token used in an element declaration to declare the
element as having mixed content (character data, or character data mixed
with other elements). The content of the element is parsed; '&' and '<'
have special meaning and must be escaped if they aren't the start of
markup.

A "CDATA section", bounded in markup by "<![CDATA[" and "]]>" is, by
comparison, "unparsed" character data (though even it is subject to at
least one restriction -- it can't contain "]]>"). A CDATA section can
only appear in element content, and it has nothing to do with the
"CDATA" token used in attribute decls.

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.