• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

a basic dtd question

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel both of the DTD specs given below give the same result. Am I right?

<!ELEMENT item (#PCDATA | item)* >
<!ELEMENT item (#PCDATA)* >
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both are different.
<!ELEMENT item (#PCDATA|item)*> can include any parsed data along with other element item in it.
but in case of<!ELEMENT item (#PCDATA)*> it can only include parsed data, it cant hold any other element item in it.
it will give an error if "<" placed in side element.

please correct if iam wrong
 
Arul Jose
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.

but that part is understood.

item is anyway a parsed data right?

why not write


instead of
?

what is the difference between the two scripts given above?

Can you please help?
[ April 11, 2006: Message edited by: ArulJose ]
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PCDATA is parsed character data. It means, that content marked as #PCDATA will be parsed - i.e. the parser will try to recognize markup in the content. Obviously, if it encounters <item> it woul treat it as an element -item-, but the DTD says, that root element cannot have any nested elements.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic