• 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

Can't ID contain numeric data??

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frnds,

I tried a DTD with ID. In this I'm not able to store the numeric value.Its showing error that the ID value should obey the naming convention.



The XML file is :
----------------------------------------------
<!DOCTYPE CONTACTS

[ <!ELEMENT CONTACTS ANY>
<!ELEMENT CONTACT ANY>
<!ATTLIST CONTACT CONTACT_NUM ID #REQUIRED>
]>
<CONTACTS>
<CONTACT CONTACT_NUM = "11"/>
</CONTACTS>
----------------------------------------------

If I give like

<CONTACT CONTACT_NUM = "num"/>

Its not giving error..

Is it mean that i can't store the numbers in ID ???

- Thanks,
Senthil.
 
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by senthil rajan:
Hi Frnds,

I tried a DTD with ID. In this I'm not able to store the numeric value.Its showing error that the ID value should obey the naming convention.




Is it mean that i can't store the numbers in ID ???

- Thanks,
Senthil.



The value for DTD id attribute has to follow the standard XML naming rules (has to eb a valid XML name) and one of the rules is
"A name cannot start with a number or punctuation character"

Thsi is one great drawback of using DTD
HTH
reply
    Bookmark Topic Watch Topic
  • New Topic