OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xml-dev] Element Occurrence and #PCDATA



Jeff,

Thanks very much! Your message was "on target" for me.

Yes, I did know most of what you wrote (and, in particular, I was aware that
the syntax "(#PCDATA)*" is watered down mixed content), but I wasn't
completely sure that there was no other possible reason for doing it. I also
know that it will validate correctly in the parsers I have tried. That's why
I used the word, "meaningful" instead of "incorrect."

Dan

-----Original Message-----
From: Jeff Rafter [mailto:jeffrafter@defined.net]
Sent: Tuesday, November 20, 2001 7:31 AM
To: Dan Mabbutt; xml-dev@lists.xml.org
Subject: Re: [xml-dev] Element Occurrence and #PCDATA


Dan,

> Is the syntax (#PCDATA)* ever meaningful?

Essentially what this says is that you may have any number of repeating
#PCDATA sections. So imagine you had a #PCDATA section that said "Dan" and
one that said "Mabbut"-- now put them together: "Dan Mabbut" technically
this is a single #PCDATA section not two together right? Essentially it has
meaning but the only time this is important is when you have mixed element
content like:

<p>Dan Mabbut<i>is</i>very<b>great</b>!</p>

Here we do have multiple #PCDATA sections which are separated by elements
(hence the phrase "mixed content"). You would declare this as follows:

<!ELEMENT p (#PCDATA | i | b)*>

Notice the similarity-- this time instead of having a repeating choice for
only #PCDATA we have a repeating choice for #PCDATA, <i>, and <b> as our
element content. (#PCDATA must always come first in mixed content
definitions).

Back to your original question: (#PCDATA)* is just a watered down mixed
content definition-- there are just no child elements in the mix. Therefore
this definition is allowed-- but it is unnecessary-- in any situation where

    (#PCDATA)*

will work--

    (#PCDATA)

will work also.

I am sure you knew most of this-- hope this answers the question--

Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting