473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

DTD Validation Error: Attribute Value "9999" of type ID must be aname.

Hi,

I am using JDOM to create and validate XML document in a Java app. for
the first time, and am getting the error above when I am validating a
document with SAXBuilder with the following DTD:

<?xml version="1.0" encoding="utf-8" ?>
<!-- DTD for a user definition file -->
<!ELEMENT user (username, password, email?)>
<!ATTLIST user id ID #REQUIRED>
<!ELEMENT username (#PCDATA)>
<!ELEMENT password (#PCDATA)>
<!ELEMENT email (#PCDATA)>
And here is the output file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE user SYSTEM "../lib/dtd/user.dtd">
<user id="9999">
<username>SomeUser</username>
<password>mypassword</password>
<email>so******@myemail.com</email>
</user>
The document was created using JDOM, and the during the creation of the
attribute :
Attribute idXML = new Attribute ("id", getId(), Attribute.ID_ATTRIBUTE);
userXML.setAttribute(idXML);
Any ideas on what I am doing wrong here ???

Thanks,

--MD.

Jul 20 '05 #1
2 1950
Marcio DeBarros <gt*****@prism.gatech.edu> writes:
<!ATTLIST user id ID #REQUIRED> <user id="9999"> Any ideas on what I am doing wrong here ???


An attribute of type ID must start with a letter or an underscore. See
<http://www.w3.org/TR/REC-xml#id>.

--
Dean Tiegs, NE¼-20-52-25-W4
“Confortare et esto robustus”
http://telusplanet.net/public/dctiegs/
Jul 20 '05 #2
Thanks that did it.

Dean Tiegs wrote:
Marcio DeBarros <gt*****@prism.gatech.edu> writes:

<!ATTLIST user id ID #REQUIRED>


<user id="9999">


Any ideas on what I am doing wrong here ???

An attribute of type ID must start with a letter or an underscore. See
<http://www.w3.org/TR/REC-xml#id>.


Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: dries | last post by:
A friend of mine has a problem with his credit card validation routine and it is probably a simple thing to solve but I cannot find it. It has to do with the expiry dates. What happens is that as...
8
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have...
2
by: Anony | last post by:
Hi All, I'm trying to create a listener server: IPAddress ipAddress = IPAddress.Parse("192.168.0.1"); IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 9999); Socket listener = new...
0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
0
by: Shan Plourde | last post by:
Hi everyone, I have been using various regular expressions with the ASP.NET RegularExpressionValidator for quite some time. In general it works very well. One of the common regex's that I use...
9
by: Bob | last post by:
I have a sql command with a SearchDate parameter of type date. When I execute its stored procedure from Query Analyzer (to SS2K) with a date out of the valid datetime range, EXEC @SearchDate =...
1
by: FunkHouse9 | last post by:
I'm trying to develop an order page and in one section, the customer specifies a shipment type using radio buttons that is submitted to the shopping cart. There are 4 buttons. If either of the...
3
by: Twanne | last post by:
Hi, I've got a table called Aerosol and a table called LinkTabel. Now I do an update to a table from an excell sheet, this table is called ExportAerosol. So far so good, the import works...
3
by: graphicssl | last post by:
Okay, so first of all, I'm a designer first and a light coder second (I'm only really trained with HTML and CSS). So I apologize for having to post about something that's probably super-trivial! ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.