• 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

Type ID in DTD

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is a sample question in XML 141 sample test.Can anyone explain me why a,d are the correct answers for this??
Which of the following would raise an error if the empID attribute's data type was defined as type ID in the DTD?
a) <name empID="17563">Joe Smith</name>
b) <name empID="ft:17563">Joe Smith</name>
c) <name empID="a17563">Joe Smith</name>
d) <name empID="">Joe Smith</name>

Thanks in advance
rkmuvva
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Attributes defined as ID must contain only characters allowed for NMTOKEN (letters, digits, point [ . ] , hyphen [ - ], underline [ _ ] and colon [ : ] ) and must start with a letter.
b and c satisfy to this rule whereas a and d don't.
For more details, please consult
Zvon.org DTD tutorial
W3C XML specification
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Attributes defined as ID must contain only characters allowed for NMTOKEN (letters, digits, point [ . ] , hyphen [ - ], underline [ _ ] and colon [ : ] ) and must start with a letter.
On the same rule, has anyone heard of Processors/Parsers giving errors because the ID value has a "." (period) in the value. Acc. to this rule, it seems to be valid.
- madhav
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic