RE: pretty printer and PCDATA

Subject: RE: pretty printer and PCDATA
From: Pieter Rijken <pieter.rijken@xxxxxx>
Date: Wed, 8 Sep 1999 13:05:17 +0200
Dear Guillame,

> > <!ELEMENT nmlist - - (#PCDATA)>      (NOT (#PCDATA)* !!)
> 
> Sorry to disturb the discussion by a question that may not be 
> relevant to
> the subject of the list but I really have problem to understand what
> #PCDATA represents.
> The definition I have is "Parsed Character Data", that is to 
> say a mixed
> of text, character entities and elements.
> So what is the difference between (#PCDATA) and (#PCDATA)* ?
> What is the point in putting:
> <!element p (#PCDATA | for | sci | fn)*> since #PCDATA 
> represent already
> any parsed character data ?
> Why not putting instead:
> <!element p (CDATA | for | sci | fn)*> ? What's the difference ?
> Is there any diference between
> <!element p (#PCDATA | for | sci | fn)*> and <!element p 
> ((#PCDATA) | for
> | sci | fn)*> ?
> 
> I realize that I am really misunderstanding the notion of 
> PCDATA. Please
> excuse my ignorance and help me.

If the dtd states:

<!ELEMENT someelement - - (#PCDATA)>
<!ELEMENT someother - - (#PCDATA)*>

and the document instance contains:

<somelement>bla  bla</somelement>
<someother>bla  bla</someother>

the contents of <somelement> is parsed as the entire string 'bla  bla'.
But the contents of <someother> could be parsed in several ways:
1) 'bla  bla',
2) 'bla', '  ', 'bla',
etc.

This makes a difference for applications using the contents of parsed
elements.

regards,

pieter


-- 
Pieter Rijken                          E-mail: pieter.rijken@xxxxxx

CMG Telecommunications and Utilities B.V.
Division Advanced Technology
Nieuwekade 1-19
P.O. Box 8038                 Phone: +31 30 2339300
3503 RA Utrecht               Fax:   +31 30 2339495
The Netherlands
-------------------------------------------------------------------

DISCLAIMER: This statement is not an official statement from, nor
            does it represent an official position of, CMG
            Telecommunications and Utilities B.V.

------------------------------------------------------------------- 


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread