Benson Margulies wrote:
See http://issues.apache.org/bugzilla/show_bug.cgi?id=23357. Perhaps ifSorry if I'm misunderstanding, I'll take a fresh look at this in the morning, but essentially you're saying that Xalan doesn't deal correctly with UTF-8 encoded data? And that by copying and pasting it into a string, I'm converting it to Latin-1.
you vote for it, someone would fix it?
Presumably an ugly workaround would be to converted the outputted XML to Latin-1 in order that Xalan can process it. Fortunately, I don't think my database contains any data that can't be expressed in the Latin-1 character set.
Thanks for pointing me in the right direction, I hope you at least agree that this diagnosis wasn't exactly obvious from the initial symptoms!
Cheers,
Jon
-----Original Message-----
From: Jonathan Melhuish [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 22, 2004 11:44 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Bizarre parse error
In the absence of any more logical suggestions, I've been randomly fiddling and have found that:
* I only get the error when I successfully retreive XML from the database and pass it to Xalan, it works or fails elegantly in all other cases
* The XML data is returned correctly and is valid, because I can output it, save it and parse it using Mozilla
* The simple XSL stylesheet that I have created (which just matches the document root) is valid because I am using it successfully on another very similar page that returns a smaller subset of the XML data
* If I copy and paste the outputted XML from the saved file into my JSP page and assign it to a string, it works
So, in summary:
* The bit that gets the XML from the database appears to work correctly
* The bit that processes the XML (Xalan) appears to work correctly when the above XML is hard-coded into a string
* It doesn't work when I try to pass the XML directly from one to the other
Any ideas?!
Cheers,
Jon
Jonathan Melhuish wrote:
I've got a rather bizarre problem which I can't quite get my head around, and was wondering if anybody might be able to help.stylesheet.
I'm using Xalan to transform XML into HTML4 using an XSLT
The page appears to be generated correctly, from looking atthe source
it is tryingcode. However, upon loading, Internet Explorer (5 and 6) gives the error:
The character '>' was expected. Error processing resource 'http://www.w3.org/TR/html4/strict.dtd'. Line 81, Position 5
-- media type, as per [RFC2045]
----^
The line number referenced is not related to the source code of my page. Mozilla, meanwhile gives the error "XML Parsing Error: mismatched tag. Expected: </link>" which would imply that
to parse it as XHTML. Changing the DOCTYPE declarationfrom Strict to
Transitional changes the line number in IE but not theerror given by Mozilla.
Removing the DOCTYPE definition completely brings IE'serror in line
as I foundwith Mozilla's.
However, all of this would perhaps seem rather irrelevant,
that saving the file to disk and re-opening it causes it to be displayed correctly in both browsers. Similarly, savingthe resultant
HTML and serving it through Tomcat also works, regardlessof whether
the filename extension is .html or .jsp. My onlysuggestion was that
perhaps it was something to do with the MIME type, but presumably Tomcat would decide that based on the filename extension if my JSP pages were not to contain the line:
<%@ page language="java" contentType="text/html" %>
This presumption is supported by the fact that removing this line makes no difference to either error.
Which leaves me completely out of ideas... help!
TIA,
Jon
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
