panmanphil at yahoo.com
Wed Nov 13 09:42:37 PST 2002
You are telling DOMBuilder to validate and you don't have a dtd.
1 - use SaxBuilder instead, it's much faster
2 - don't validate unless you have a dtd. You still validate that the document
is well formed, even with validate set to false, because that's just the way
xml is ;-)
--- Stefanos Kaklamanis <stefka at gnt.gr> wrote:
> I'm POSTing an xml-jdom document (through an application) to a servlet, that
> it reads the stream (using the request.getReader). Then, it creates another
> xml doc kai POST it back (using XMLOutputter).
> The problem i have is when the application is trying to build the xml
> document from the response stream.
> DOMBuilder builder = new DOMBuilder(true);
> outDoc = builder.build(conn.getInputStream()); <---------
> I take the following error:
> org.jdom.JDOMException: Error on line 2 of XML document: Element type "books"
> must be declared.
> the repsonse xml is the following:
> <?xml version="1.0" encoding="UTF-8"?>
> <book isbn="123">
> <title>Web Servers for Fun and Profit</title>
> <book isbn="456">
> <title>Web Programming for Mobile Devices</title>
> Any idea?
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
More information about the jdom-interest