You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Em...@tcc.thomson-csf.com on 2001/01/24 16:11:29 UTC

white space in attribute value

Hi,

I have some problems with white space in attribute value.
I want to generate one XML file by transforming an other via XSLT processed
by XALAN like this :
<xsl:element name="foo">
   <xsl:attribute name="bar"><xsl:value-of select="X"> <xsl:value-of
select="Y"></xsl:attribute>
</xsl:element>

I want to obtain :
<foo bar="V1 V2">

but I never have a white space between V1 and V2. If the element foo is
generated by :
<xsl:element name="foo">
   <xsl:attribute name="bar"><xsl:value-of select="X"> <xsl:value-of
select="Y">
   </xsl:attribute>
</xsl:element>

the result is :
<foo bar="V1V2&#10;   ">
The white spaces are at the end of the value and not inside.

How can I do ? Thanks.

Emmanuel

Re: white space in attribute value

Posted by Torkild Ulvøy Resheim <tr...@online.no>.
Try:

<xsl:element name="foo">
   <xsl:attribute name="bar"><xsl:value-of select="X"><xsl:text>&#x0020;</xsl:text><xsl:value-of
select="Y"></xsl:attribute>
</xsl:element>
--
  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´



----- Original Message ----- 
From: <Em...@tcc.thomson-csf.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, January 24, 2001 4:11 PM
Subject: white space in attribute value


> Hi,
> 
> I have some problems with white space in attribute value.
> I want to generate one XML file by transforming an other via XSLT processed
> by XALAN like this :
> <xsl:element name="foo">
>    <xsl:attribute name="bar"><xsl:value-of select="X"> <xsl:value-of
> select="Y"></xsl:attribute>
> </xsl:element>
> 
> I want to obtain :
> <foo bar="V1 V2">
> 
> but I never have a white space between V1 and V2. If the element foo is
> generated by :
> <xsl:element name="foo">
>    <xsl:attribute name="bar"><xsl:value-of select="X"> <xsl:value-of
> select="Y">
>    </xsl:attribute>
> </xsl:element>
> 
> the result is :
> <foo bar="V1V2&#10;   ">
> The white spaces are at the end of the value and not inside.
> 
> How can I do ? Thanks.
> 
> Emmanuel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> 
>