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

Discussion in 'XML' started by Marcio DeBarros, Oct 1, 2003.

  1. 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></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.
     
    Marcio DeBarros, Oct 1, 2003
    #1
    1. Advertising

  2. Marcio DeBarros

    Dean Tiegs Guest

    Re: DTD Validation Error: Attribute Value "9999" of type ID must bea name.

    Marcio DeBarros <> 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/
     
    Dean Tiegs, Oct 1, 2003
    #2
    1. Advertising

  3. Re: DTD Validation Error: Attribute Value "9999" of type ID mustbe a name.

    Thanks that did it.

    Dean Tiegs wrote:
    > Marcio DeBarros <> 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>.
    >
     
    Marcio DeBarros, Oct 2, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2ltb24=?=

    re configure data adapter (9999) not

    =?Utf-8?B?c2ltb24=?=, Jan 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    290
    =?Utf-8?B?c2ltb24=?=
    Jan 23, 2004
  2. JavaRookie
    Replies:
    4
    Views:
    1,686
    Gerbrand van Dieijen
    Oct 13, 2003
  3. Kent Tong
    Replies:
    4
    Views:
    442
    Richard Tobin
    Feb 23, 2004
  4. Nathan Pickett

    Calendar Control: Breaks if set to December 9999

    Nathan Pickett, Feb 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    108
    Nathan Pickett
    Feb 27, 2004
  5. Nathan Pickett

    Calendar Control: Exception with December 9999 Date

    Nathan Pickett, Feb 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    247
    Ken Cox [Microsoft MVP]
    Feb 28, 2004
Loading...

Share This Page