Re: Parsing an XML document without a root element

2005-08-17 Thread Sogol G
Thanks for your help. The parser method of DOMParser actually uses an InputSource instead of an InputStream so I wrote a new Reader and passed it to its character stream. It's kind of similar to your suggestion. Thanks again :) --- [EMAIL PROTECTED] wrote: > actually that is stupid. > > Your

Re: Parsing an XML document without a root element

2005-08-17 Thread dbrosius
actually that is stupid. Your stream should just be class MultiStream extends FilterStream { InputStream[] streams; int curStream = 0; public MultiStream(InputStream[] streams) { this.streams = streams; } public int read() { int b; while (

Re: Parsing an XML document without a root element

2005-08-17 Thread dbrosius
This solution has nothing to do with xml, just create your own Reader or stream class, and before returning the real data, return the "" string. When all the real data is exhausted, return here's some pseudo code, haven't tried it just typing it in to email. you'd probably have to handle reading

Re: Parsing an XML document without a root element

2005-08-17 Thread dbrosius
Perhaps create your own stream class that prefixes and postfixes a valid root, and pass that to the parser. Quoting Sogol G <[EMAIL PROTECTED]>: > Hello, > > I have an XML document that's not well-formed. It's > missing its root element. The rest of it is > well-formed. > > EX: it's like this

Re: Parsing an XML document without a root element

2005-08-17 Thread Sogol G
could you please elaborate a little more on this? --- Joseph Kesselman <[EMAIL PROTECTED]> wrote: > Write a wrapper document that pulls in this file as > an external parsed > entity. > > __ > Joe Kesselman, IBM Next-Generation Web Technologies: > XML, XSL an

Re: Including an xml-file into another xml-file

2005-08-17 Thread Stanimir Stamenkov
/Sogol G/: It is well-formed!! Does the "log.xml" parse alone without errors? Could you try replacing "log.xml" with simpler document which can be verified reliably by human inspection only then repeat the test again? Could you supply us with the original "log.xml"? BTW, I didn't understa

Re: Including an xml-file into another xml-file

2005-08-17 Thread Sogol G
It is well-formed!! BTW, I didn't understand your last mail about wrapping the document. Can you please elaborate? thanks --- Joseph Kesselman <[EMAIL PROTECTED]> wrote: > Sounds like the file you're trying to read in isn't > even a well-formed XML > entity. Fix it? > > _

Re: Including an xml-file into another xml-file

2005-08-17 Thread Joseph Kesselman
Sounds like the file you're trying to read in isn't even a well-formed XML entity. Fix it? __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioact

Including an xml-file into another xml-file

2005-08-17 Thread Sogol G
I have a file called a.xml that looks like this: ]> &service; When I parse in Xerces. I get this: Fatal Error] servicelog.xml:2234:3: The element type "ac" must be terminated by the matching end-tag "". The element type "ac" must be terminated by the matching end-tag "". org.xml.sa

Re: Parsing an XML document without a root element

2005-08-17 Thread Joseph Kesselman
Write a wrapper document that pulls in this file as an external parsed entity. __ Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more. "The world changed profoundly and unpredictably the day Tim Berners Lee got bitten by a radioactive spider."

Parsing an XML document without a root element

2005-08-17 Thread Sogol G
Hello, I have an XML document that's not well-formed. It's missing its root element. The rest of it is well-formed. EX: it's like this: . . I need to parse this document using Xerces. I have a few ideas of how I should do this, but I wanted to also ask you guys to see if there are easier