Joseph,
I finally found out that appareantly the 'The root element is required in a
well-formed document.' is caused when I try to detect if a xmlstream has a
xslfile defined via the href= attribute:
try { // Check if xml has link to stylesheet
System.err.println("Looking for XSL file...");
// Look for stylesheet in xmlfile/stream/reader
if (xmlfile != null) {
System.err.println("Looking in xmlfile");
xslsource = tfactory.getAssociatedStylesheet(new
StreamSource(xmlfile),media, title, charset);
if (xslsystemid == (null))
xslsystemid = xmlfile.toString();
} else {
if (xmlstream != null) { // IT GOES WRONg HERE !
xslsource = tfactory.getAssociatedStylesheet(new
StreamSource(xmlstream),media, title, charset);
System.err.println("Looking in xmlstream");
} else {
if (xmlreader != null) {
xslsource = tfactory.getAssociatedStylesheet(new
StreamSource(xmlreader),media, title, charset);
System.err.println("Looking in xmlreader");
}
}
}
As long as it is a xmlFILE then there is no problem, but when it is a
xmlstream the problem arises (didn't check with a xmlreader).
I use XalanD22R14.
Is this a bug, do I something wrong or is this maybe solved in 2.3.1 ?
Regards,
Stefan
----- Original Message -----
From: "Joseph Kesselman/CAM/Lotus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 29, 2002 3:59 PM
Subject: Re: The root element is required in a well-formed document.
>
> Have you tried printing the content of the stream to make sure that what's
> being retrieved is, in fact, a well-formed XML document?
>
> (For what it's worth, that error message is actually coming from Xerces,
> before Xalan per se sees the document's content.)
>
>
>