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

RE: Element Occurrence and #PCDATA


pcdata xml

If an element is just #PCDATA, then an occurance indicator shouldn't
be present, i.e.,

<!ELEMENT a (#PCDATA)>

Only data is allowed.  However, if you have mixed content, #PCDATA
and other elements, then a * (zero or one) is required, i.e.,

<!ELEMENT a (#PCDATA | b | c)*>

I think an important point is that the parser doesn't really validate
that data is present.  In both examples, <a></a> will pass the parse.

Hope this helps.

Betty

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey, XML Consultant,        | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey@e...                    | Washington,DC SGML/XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/

On Tue, 20 Nov 2001, Dan Mabbutt wrote:

> Betty,
>
> Thanks for the response, but it wasn't quite what I was asking. I'm aware of
> the differences between CDATA and #PCDATA. (I only mentioned that because it
> was the subject of the single authoritative reference I could find in
> Simon's book.) I should have been more clear in my question, but I didn't
> want to suggest my own conclusion too strongly.
>
> My question is about the use of the Element Occurrence Indicator in this
> syntax.  That would suggest that the DTD is requiring zero or more
> occurrences of #PCDATA and I can't quite imagine why it would ever be
> meaningful to include that syntax in the DTD.
>
> Dan
> -----Original Message-----
> From: Betty Harvey [mailto:harvey@e...]
> Sent: Tuesday, November 20, 2001 7:09 AM
> To: Dan Mabbutt
> Cc: Simon St.Laurent; xml-dev@l...
> Subject: Re:  Element Occurrence and #PCDATA
>
> Dan:
>
> 	#PCDATA represents "Parsed Character Data".  Years ago when I
> first started working with SGML, I had the same question. I saw the
> #PCDATA and thought what is the difference between Personal Computer (PC)
> Data and UNIX or VMS data.  Basically is means that the parsers looks at
> every character.
>
> 	Character Data (CDATA - only valid in attributes and
> Marked Sections in XML) says that the parser will not look at the
> characters in a CDATA element.
>
> 	Hope this helps.
>
> Betty
>
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> Betty Harvey, XML Consultant,        | Phone: 410-787-9200 FAX: 9830
> Electronic Commerce Connection, Inc. |
> harvey@e...                    | Washington,DC SGML/XML Users Grp
> URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
>
>
> On Tue, 20 Nov 2001, Dan Mabbutt wrote:
>
> > I have a question about a slightly obscure syntax of #PCDATA in a DTD.
> >
> > Is the syntax (#PCDATA)* ever meaningful?
> >
> > I've searched the archives for this group, Googled the Web, and searched
> > every text I have.  The only references I can find are in "XML For
> Dummies"
> > (2nd Ed.) where the syntax is used quite extensively on page 85 and 86 and
> > one single reference on page 232 of Simon St. Laurent's "XML A Primer" by
> > Simon St.Laurent that is really about CDATA and the use of the syntax may,
> > or may not, be meaningful. (That's why this message is also directed to
> Mr.
> > St.Laurent.)
> >
> > Thanks!
> >
> > Dan Mabbutt
> >
> >
> > -----------------------------------------------------------------
> > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> > initiative of OASIS <http://www.oasis-open.org>
> >
> > The list archives are at http://lists.xml.org/archives/xml-dev/
> >
> > To subscribe or unsubscribe from this list use the subscription
> > manager: <http://lists.xml.org/ob/adm.pl>
> >
>
> --
>
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
>
>

-- 



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.