All,
A while back I had a similar problem when a XMLOutputter XMLSerializer was
used prior to adding the document. These outputter added a 'charater' at the
beginning of the file (I could see it with KHexEdit);
Follows here how I get round it. Nobody in the community could explain why
this was happening ;(
Problem:
--------------------------------------------------------------------------------------
The symptoms of this problem is that I cannot store a document to xindice
as String or DOM.
DOM parse a document stored in an OutputStream by XMLOutputter
e.g.
JDOM->XMLOutputter.output(Document OutputStream)->DOMParser(InputStream)
I keep on getting
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:381)
on line 1: Content is not allowed in prolog.
Solution
--------------------------------------------------------------------------------------
Look at my code snippet
.....
/** WARNING it's important to trim the string
* because when XMLOutputter, DOMOutputter, XMLSerializer
* is used to populate the outputstream; they append
* charaters unwanted by most XML parsers.
*/
XMLResource src.setDocument(doc.trim())
storeResource(rsc)
......
On Thursday 12 Feb 2004 11:18 am, [EMAIL PROTECTED] wrote:
> In a message dated 2/12/2004 11:15:54 AM GMT Standard Time,
>
> [EMAIL PROTECTED] writes:
> > Here is the first line of the document:
> > <?xml version="1.0" encoding="UTF-8"?>
>
> Vladimir,
>
> Assuming you don't have whitespace or any other character before the XML
> declaration then I don't see why Xindice is choking on this.
>
> Could we see the beginning of your document up to and including the start
> tag of your document element?
>
> Thanks.
>
> Andrew Watt
--
Best Regards.
JC.
\\- - -//
( @ @ )
===oOOo-(_)-oOOo=================================================
[EMAIL PROTECTED]
=================================================================