#6 MX4J tools: XSL templates: incorrect 'url' creation.

open
nobody
None
5
2005-10-28
2005-10-28
Alexey Sergeev
No

XSLT files are placed in package
mx4j.tools.adaptor.http.xsl
For array file 'viewarray.xsl' is used. The following
code is used for variable 'url' creation:

<xsl:variable name="url">getattribute?objectname=
<xsl:call-template name="uri-encode">
<xsl:with-param name="uri">
<xsl:value-of select="$request.objectname"/>
</xsl:with-param>
</xsl:call-template>&amp;attribute=
<xsl:value-of
select="$request.attribute"/>&amp;format=array&amp;template=viewarray&amp;locale=
<xsl:value-of select="$request.locale"/>
</xsl:variable>

It is not correct becuase it is produces bad url, like:

....getattribute?objectname=%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20CruiseControl+Manager.....

Tag <xsl:text> should be used to get rid of unnecessary
white space (like %0A%20%). So correct code will look like:

<xsl:variable
name="url"><xsl:text>getattribute?objectname=</xsl:text>
<xsl:call-template name="uri-encode">
<xsl:with-param name="uri">
<xsl:value-of select="$request.objectname"/>
</xsl:with-param>
</xsl:call-template><xsl:text>&amp;attribute=</xsl:text>
<xsl:value-of
select="$request.attribute"/><xsl:text>&amp;format=array&amp;template=viewarray&amp;locale=</xsl:text>
<xsl:value-of select="$request.locale"/>
</xsl:variable>

The same problem exists in viewcollection.xsl and
viewmap.xsl.

Discussion

  • Alexey Sergeev
    Alexey Sergeev
    2005-10-28

    Modified files archive

     
    Attachments