|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: 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@d...] Sent: Tuesday, November 20, 2001 7:31 AM To: Dan Mabbutt; xml-dev@l... Subject: Re: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








