You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ivan Luzyanin <iv...@ProZa.Lviv.UA> on 2002/09/04 09:16:25 UTC

xsl:strip-space problem

I have problem using xsl:strip space. It seems dosn't work with cocoon's xsl 
transformer.

Example:

my xsp:

<xsp:page ...>
<root>
...
<esql:connection>
...
	<user>
	<esql:row-results>
		<name>
			<esql:get-string column="name"/>
		</name>
	</esql:row-results>
	</user>
...
</root>
</esql:connection>
...
</xsp:page>

and my xsl:

<xsl:stylesheet ..>
<xsl:strip-space elements="*"/>
...
<xsl:template match="name">
		<INPUT type="text" name="username">
			<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
		</INPUT>
</xsl:template>
...
</xsl:stylesheet>

And after transformation username field (and other fields) contain a lot of 
spaces, but i'm sure they should not...
Of course i can use normalize-space()method for each value, but i guess it's 
not the best way over this problem.

Ivan.

Env: cocoon 2.0.3, tomcat4.0.4, JDK1.4.0_01, SuSE Linux 8.0

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: xsl:strip-space problem

Posted by Joerg Heinicke <jo...@gmx.de>.
AFAIK and I understand the spec (http://www.w3.org/TR/xslt#strip) 
xsl:strip-space applies only to whitespace-only text nodes. This means it 
doesn't replace the normalize-space() function, but only removes "empty" 
text nodes. So you will have to use normalize-space() or write the xsp-code 
in one line:

<name><esql:get-string column="name"/></name>

Regards,

Joerg


Ivan Luzyanin wrote:
> I have problem using xsl:strip space. It seems dosn't work with cocoon's xsl 
> transformer.
> 
> Example:
> 
> my xsp:
> 
> <xsp:page ...>
> <root>
> ...
> <esql:connection>
> ...
> 	<user>
> 	<esql:row-results>
> 		<name>
> 			<esql:get-string column="name"/>
> 		</name>
> 	</esql:row-results>
> 	</user>
> ...
> </root>
> </esql:connection>
> ...
> </xsp:page>
> 
> and my xsl:
> 
> <xsl:stylesheet ..>
> <xsl:strip-space elements="*"/>
> ...
> <xsl:template match="name">
> 		<INPUT type="text" name="username">
> 			<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
> 		</INPUT>
> </xsl:template>
> ...
> </xsl:stylesheet>
> 
> And after transformation username field (and other fields) contain a lot of 
> spaces, but i'm sure they should not...
> Of course i can use normalize-space()method for each value, but i guess it's 
> not the best way over this problem.
> 
> Ivan.
> 
> Env: cocoon 2.0.3, tomcat4.0.4, JDK1.4.0_01, SuSE Linux 8.0


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>