xsl-list
[Top] [All Lists]

RE: how to concatenate fields?

2005-03-07 14:15:28
i also tried to store all 3 fields in a variable, but i can't get the variable 
to display - any ideas are appreciated

<xsl:variable name="revBody"><b><xsl:value-of select="location"/> -- 
<xsl:value-of select="publish_date"/> -- </b><xsl:apply-templates 
select="/gapinc/body_text"/></xsl:variable>

Tiffany

-----Original Message-----
From: Tiffany Blake [mailto:Tiffany_Blake(_at_)gap(_dot_)com]
Sent: Monday, March 07, 2005 1:13 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] how to concatenate fields?


i'm 95% done.  the only problem i'm having is getting the "body_text" on the 
first line:

WRONG:
"location" - "publish_date" -
"body_text"

how do i get it to look like:
"location" - "publish_date" - "body_text"

-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm(_at_)yahoo(_dot_)de]
Sent: Monday, March 07, 2005 1:00 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] how to concatenate fields?


Tiffany Blake wrote:
does this look correct?

Not quite.

<xsl:if test="string-length(location)&gt;0">
     <p><b><xsl:value-of select="location"/></b>" - "
                                                         ^
The linefeed  and the space used for indentation on the next line
will appear in the output and produce a visible space in the browser.
The quotes will also appear in the output.
You should use xsl:text here (see below)

     <xsl:value-of select="publish_date"/>" - "</p>
The </p> end tag will end the block, i.e. you are getting
a new line in the browser.

Try
   <p>
     <xsl:if test="string-length(location)&gt;0">
       <b><xsl:value-of select="location"/></b>
       <xsl:text>-</xsl:text>
       <xsl:value-of select="publish_date"/>
       <xsl:text>-</xsl:text>
     </xsl:if>
     <xsl:if test="string-length(/gapinc/body_text)&gt;0">
       <xsl:apply-templates select="/gapinc/body_text"/>
     </xsl:if>
   </p>

J.Pietschmann

--~------------------------------------------------------------------
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>
--~--




--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>