[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [xml-dev] Element Occurrence and #PCDATA
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."
From: Jeff Rafter [mailto:email@example.com]
Sent: Tuesday, November 20, 2001 7:31 AM
To: Dan Mabbutt; firstname.lastname@example.org
Subject: Re: [xml-dev] Element Occurrence and #PCDATA
> 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
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
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
will work also.
I am sure you knew most of this-- hope this answers the question--
XML Development and Developer Web Hosting