You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Christopher Kohlhaas <ko...@cs.uni-bonn.de> on 2002/02/22 22:28:27 UTC
PATCH: xsp.xsl and esql.xsl strip whitespace incorrectly
Hello Cocooners,
I've come along the following whitespace problem in esql.xsl and xsp.xsl
The esql fragment:
<esql:query>select * from test_table where id =
<esql:parameter>
<xsp:expr>id</xsp:expr>
</esql:parameter>
</esql:query>
produces the following code
_esql_query.getPreparedStatement().setString(1, String.valueOf(""
+ " "
+ (id)
+ " "));
I found a similiar problem with the following expression
<xsp:attribute name="name">
<esql:get-string column="name"/>
</xsp:attribute>
Is this intended or a bug?
If that is non intended behaviour, I would propose the following sollution:
Add the xsl:strip-space instruction at the beginning of esql.xsl:
<xsl:strip-space elements="esql:parameter esql:driver esql:dburl esql:username esql:password esql:pool esql:property esql:max-rows esql:skip-rows esql:encoding"/>
and at the beginning of xsp.xsl add:
<xsl:strip-space elements="xsp:attribute xsp:expr xsp:param xsp:element"/>
Christopher
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: PATCH: xsp.xsl and esql.xsl strip whitespace incorrectly
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Christopher Kohlhaas [mailto:kohlhaas@cs.uni-bonn.de]
>
> Hello Cocooners,
>
> I've come along the following whitespace problem in esql.xsl and
xsp.xsl
>
> The esql fragment:
>
> <esql:query>select * from test_table where id =
> <esql:parameter>
> <xsp:expr>id</xsp:expr>
> </esql:parameter>
> </esql:query>
>
> produces the following code
>
> _esql_query.getPreparedStatement().setString(1, String.valueOf(""
> + " "
> + (id)
> + " "));
>
> I found a similiar problem with the following expression
>
> <xsp:attribute name="name">
> <esql:get-string column="name"/>
> </xsp:attribute>
>
> Is this intended or a bug?
I think it is intended (especially in the xsp:element). You may want to
generate white space symbols, which are no different in XML from
non-white space symbols. White spaces play important role in plain text
output generation.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org