[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: how to concatenate fields?

Subject: RE: how to concatenate fields?
From: "Tiffany Blake" <Tiffany_Blake@xxxxxxx>
Date: Mon, 7 Mar 2005 13:12:30 -0800
xsl concatenate string
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@xxxxxxxx]
Sent: Monday, March 07, 2005 1:00 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.