[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: The case of the mysteriously corrupted XSL transf
Hi Wong,
I made a simple testcase, that demonstrates Mozilla/Gecko/Transformiix does have a problem with javascript document.write: === test.xsl === <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" /> <xsl:template match="/"> <html> <head><title>test</title></head> <body> <div> <script type="text/javascript"> document.write('hello'); </script> </div> </body> </html> </xsl:template> </xsl:stylesheet> === input.xml === <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <dummy/> === saxon output.html === <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test</title> </head> <body> <div> <script type="text/javascript"> document.write('hello'); </script> </div> </body> </html> The output.html generated by Saxon works fine in IE6 and Moz (browser says 'hello'). Opening input.xml (ie. transforming via the xml-stylesheet PI) works fine in IE6 too, but not in Firefox: blank page, and javascript error: "document.write is not a function". (Firefox 1.0 and Netscape 7.2 show the same result) I don't know if this is "normal", or a Mozilla/Gecko bug... I think it should work - I have used methods like appendChild succesfully, why should document.write fail here? Maybe some other xslister can elaborate... Best regards, Anton Wong Chin Shin wrote: Hi Anton,
|
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
|