Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

a basic dtd question

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
It's feeding time! Give me the food you were going to give to this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic