[xsl] Document() and &

Subject: [xsl] Document() and &
From: "Josh Beach" <josh.beach@xxxxxxxxxxx>
Date: Tue, 14 May 2002 11:51:17 +0200
Good day all,

I am trying to read in a source document mid way through a translation using the Document function. This works great when the parameter passed to the document function is a reference to a file on the local machine or when it is a URI reference. ie.
<xsl:apply-templates select="document('aDocument.xml')"/>
<xsl:apply-templates select="document('http://www.somewhere.com/aDocument.xml')"/>

It also works if the passed parameter is a variable, include, or a param. ie.
<xsl:apply-templates select="document($DocumentReference)"/>
<xsl:apply-templates select="document(@DocumentReference)"/> in the case of include.

So on to my problem... what I need is for the reference to contain an ampersand. ie.
<xsl:apply-templates select="document('http://www.somewhere.com/getDocument.html?docType=xml&amp;id=12345')"/>

This will not work and gives the following error "Error while parsing 'http://www.somewhere.com/getDocument.html?docType=xmlid=12345'. Missing equals sign between attribute and attribute value". Some where along the line the ampersand gets removed. I have also tried using just a '&' instead of a '&amp;' (even thought I know that it is improper to do so) and get the same error.

Any help would be greatly appreciated.
Josh Beach

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread