M
Marcio DeBarros
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 protected]</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.
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 protected]</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.