Antw: [jdom-interest] DTD problem

Cagan Senturk cagan at skyscout.com
Tue Nov 21 07:34:38 PST 2000


Judith, thanks for your reply. But that did not fix the problem either,
I even simplified my xml file and dtd further and made them as following:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE skyscout SYSTEM "http://localhost:7700/test.dtd">
<skyscout>
<folder/>
</skyscout>



<?xml version='1.0' encoding='UTF-8'?>
<!ELEMENT skyscout (folder)>
<!ELEMENT folder EMPTY>


and this did not work either.

Thanks,
Cagan


-----Original Message-----
From: Judith Andres [mailto:J.Andres at wika.de]
Sent: Tuesday, November 21, 2000 2:10 AM
To: jdom-interest at jdom.org; cagan at skyscout.com
Subject: Antw: [jdom-interest] DTD problem


Cagan,

you forgot to specify the parent and the title element in your dtd.
And you have to give an attribute list of the folder element.

<?xml version='1.0' encoding='UTF-8'?>
<!ELEMENT skyscout (folder+)>
<!ELEMENT folder  (parent, title)>
<!ATTLIST folder
    id CDATA #IMPLIED>
<!ELEMENT parent EMPTY>
<!ELEMENT title (#PCDATA)>

Instead of <!ELEMENT parent EMPTY> you could, of course, use
<!ELEMENT parent (#PCDATA)>

Judith

>>> "Cagan Senturk" <cagan at skyscout.com> 21.11.2000  00.15 Uhr >>>
I am having a weird problem reading in a very simple xml file with a very
basic dtd using a SAXBuilder (validation on, default Xerces parser).

The error message I get is the following:

org.jdom.JDOMException: Document root element "skyscout", must match DOCTYPE
root "skyscout".: Error on line 3 of document
http://localhost:7700/test.xml: Document root element "skyscout", must match
DOCTYPE root "skyscout".

It's being generated by SAXBuilder.java (line 310).

When I use the DOMBuilder, there are no problems.



Here is the content of the test.xml file:
<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE skyscout SYSTEM "http://localhost:7700/test.dtd">

<skyscout>

<folder id="MySkyScout">

<parent/>

<title>My SkyScout</title>

</folder>

</skyscout>



and the test.dtd contains:

<?xml version='1.0' encoding='UTF-8'?>

<!ELEMENT skyscout (folder+)>

<!ELEMENT folder (#PCDATA)>



Thanks in advance for any help,

Cagan
cagan at skyscout.com
www.skyscout.com





More information about the jdom-interest mailing list