aspose file tools*
The moose likes Product and Other Certifications and the fly likes Can't  ID contain numeric data?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Can Watch "Can New topic
Author

Can't ID contain numeric data??

senthil rajan
Ranch Hand

Joined: Aug 31, 2005
Posts: 36
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.
Hari Vignesh Padmanaban
Ranch Hand

Joined: Oct 07, 2003
Posts: 578
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't ID contain numeric data??
 
Similar Threads
Best practices for avoiding DisplayTag:Table NullPointers
Need Some Help Regarding the Validation -- Struts2
JPA many-to-many with extra attribute
dtd tags
My phone has only 2 contacts, but when I query for them I get 5, how can this be?