[xslt] possible bug in document() function.



Aloha,

When passing a URI with escape codes to document() the escape codes
are decoded before the request is sent to the web server...

e.g.
<xsl:apply-templates select="document('http://xslt.org/escape%20space.xml')"/>
results in the following HTTP request:
GET /escape space.xml HTTP/1.0

Since the URI is invalid, the web server returns an error.
The HTTP request should be:
GET /escape%20space.xml HTTP/1.0

Now I've searched through this list and found that the reason why document()
decodes URIs is to handle cases such as the following:
<xsl:apply-templates select="document('file:///local/escape%20space.xml')"/>

In this case, we want to decode the URI and read /local/escape space.xml
from the local file system, but I think the http case needs to be handled
differently to prevent invalid HTTP requests.  While I'm not sure about ftp,
http seems to be a special case where the URI passed to document()
should *not* be decoded.  Anyone disagree with my analysis?

- Glen Nakamura



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]