• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic