Win a copy of Succeeding with AI 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Type ID in DTD

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic