[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: DOCTYPE public and system fields run together in
Michael Tracey Zellmann wrote:
I have not been able to find an answer in the archives. The easiest? Convince your user to use XSLT 2.0 with Saxon or Gestalt now that (s)he has a good reason to do so. Why use a (though proven) 8 years old technique when the new one is (also proven) much more versatile and promises a higher TTM? But if you are stuck with using Xalan, here's what you should do: 1. Check your serialization code. Xalan is not likely to make this mistake, no recent version at least. 2. Check your Xalan version with the template below. If it shows nothing, you use an old version, then remove everything in the XPath after 'checkEnvironment()' and investigate the output. 3. If you can't solve it with (1) or (2), use the xsl:text hack with disable-output-escaping to provide the correct string. But you shouldn't need (3). Here's the template that I tried with Xalan 2.7.0 (including a copy and paste of your code above). Not the newest, I believe, but new enough. Below it, you'll find the output. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xalan="http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd" method="html" indent="yes" encoding="ISO-8859-1" media-type="text/html"/> <xsl:template match="/"> <html> <head> <title>Show Xalan version</title> </head> <body> <p> <xsl:copy-of select=" xalan:checkEnvironment() /*/*/*[@key = 'version.xalan2x']/text()"/> </p> </body> </html> </xsl:template> </xsl:stylesheet> The output from the above stylesheet, when run with Xalan, surprisingly doesn't indent (most other processors do when you ask them to) but for the rest of it, there's nothing odd I can find (and note that the quoted strings in the doctype are separated by a space): <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:xalan="http://xml.apache.org/xalan"> <head> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Show Xalan version</title> </head> <body> <p>Xalan Java 2.7.0</p> </body> </html> The only difference with your statements was the version of the Java JDK. I used 1.5.0_02 for this test. It is possible that the bug is introduced only in a later version (of JDK or Xalan or Xerces or JAXP or SAX), but I find it quite unlikely. Hope this brings you closer to a solution, Cheers, -- Abel Braaksma
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|