HTML output method and & in URLs 2003-01-28 - By Angus McIntyre
I have a stylesheet processor based on Xalan and Ant which I'm using to generate HTML pages from XML. Within my pages, I have some URL strings containing arguments, separated by '&'. In the input document, the form is:
arg1=foo&arg2=bar&arg3=baz
The final HTML output contains the string
arg1=foo&arg2=bar&arg3=baz
which fails validation as HTML, because it uses '&' rather than '&'.
My stylesheet defines the output method as:
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd" xalan:omit-meta-tag="yes"/>
If I change the method to 'xml', the '&' entities are not converted, so it's presumably the HTML conversion process that is doing this. Setting:
xalan:use-url-escaping="no"
doesn't seem to fix the problem.
Is there any way around this, or am I going to have to hack my processor to reencode the '&' characters as entities?
Thanks
Angus -- angus@(protected) http://pobox.com/~angus
|
|