xsl-list
[Top] [All Lists]

RE: [xsl] xsl:attribute introducing a lot of whitespace

2007-02-27 13:00:58
<td><a href="#{translate(name,' ','_')}" name="{translate(name,' 
','_')}"><xsl:value-of select = "name"/></a></td>

-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Vijay <rao_vij(_at_)yahoo(_dot_)com>
Sent:     Tue, 27 Feb 2007 10:49:26 -0800 (PST)
To:       XslList <XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  [xsl] xsl:attribute introducing a lot of whitespace

Hello,

I am using xsl:attribute to generate href links .Here is my code. The xml is a 
simple juicers and then multiple juicer with various attributes. I need to 
create bookmark type links within the same page.

      <xsl:variable name="namevar" select="name"/>
         <td>
          <a>
           <xsl:attribute name="href">
            #<xsl:value-of select="translate($namevar,' ','_')"/>_desc
           </xsl:attribute> 
           <xsl:attribute name="name">
            <xsl:value-of select="translate($namevar,' ','_')"/>_cost
           </xsl:attribute>
     <xsl:value-of select = "name"/>           
          </a>
        </td>

Here is where the above link would point to

          <a>
           <xsl:attribute name="href">
            #<xsl:value-of select="translate($namevar,' ','_')"/>_cost          
 
           </xsl:attribute> 
           <xsl:attribute name="name">
            <xsl:value-of select="translate($namevar,' ','_')"/>_desc
           </xsl:attribute>
           <xsl:value-of select = "name"/>
          </a>


I see that the generated html from the browser produces a lot of whitespace. 
This is what I see in the generated source and because of the whitespace the 
links don't work. 

<td><a href="
            #OJ_Home_Juicer_desc
           " name="OJ_Home_Juicer_cost
           ">OJ Home Juicer</a></td>
<td>

When I strip the white space and bring it in one line in the html and then open 
and click the links it works fine.

How can I make this work?

Thanks in advance
VJ


 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--