• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

dtd confusion

 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
came across this one:
I have the following xml file:
<Relation>
<Me>
<Name>
Axel
</Name>
</Me>
<Other>
<Name>
<First>
Joe
</First>

<Last>
Stranger
</Last>
</Name>
</Other>
</Relation>
When I now write a dtd it would look like this:
<!Element Relation (Me, Other) >
<!Element Me (Name) >
<!Element Name (#PCDATA)>
<!Element Other (Name) >
<!Element Name (First, Last) >
<!Element First (#PCDATA)>
<!Element Last (#PCDATA)>
Now there are TWO Name definitions in dtd.
(O.k. I can test it. Will do it later today.)
How does dtd-validator find right definition for tag <name> in dtd for that element. There are 2 definitions?
Or must every tag-name in structure be unique if we use dtd?
Found nothing about this problem in dtd chapter of xml2 by wrox.
Thanks. Axel
[ January 19, 2003: Message edited by: Axel Janssen ]
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to change one of the <Name> elements to something else.
 
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe only the first definition will
be used.
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Extensible Markup Language (XML) 1.0 (Second Edition):
"Validity constraint: Unique Element Type Declaration
No element type may be declared more than once."
http://www.w3.org/TR/REC-xml#elemdecls
 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic