xsl-list
[Top] [All Lists]

RE: Concat function - URGENT pls

2003-03-10 16:44:42
From: Challa, Harsha [mailto:hchalla(_at_)newbreed(_dot_)com]
Sent: Monday, March 10, 2003 4:22 PM
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Concat function - URGENT pls

I give up 

I am having trouble using the concat function 
I am just forming a date time element by selecting values of 
date and time
elements
I am getting all sorts of errors, syntactical 

Source
<PODDate>3/10/2003</PODDate>
<PODTime>9:14</PODTime>

Needs to be transformed to
<MovementDateTime>03/17/2003(_at_)09:14:0</MovementDateTime>



<xsl:element name="MovementDateTime">
                                                      <xsl:value-of
select= "concat(
                                      
                                              &lt;value-of
select="//MovementDate">&lt;xsl:value-of>,'@', &lt;value-of
select="//MovementTime"></xsl:value-of>,':00')"/>
      
</xsl:element>

First, keep in mind that concat() and other XPath/XSLT functions accept
expressions, not literal XSLT elements, as arguments.

Second, there appears to be a mismatch in your expressions: you look for
//MovementDate, but your source says <PODDate>.  This should do it:

<MovementDateTime><xsl:value-of
select="concat(//PODDate,'@',//PODTime,':00')"/></MovementDateTime>

BTW, Can I concat any number of strings with the concat function?

Yes.

hth,
b.

| brian martinez                              
brian(_dot_)martinez(_at_)trip(_dot_)com |
| lead gui programmer                                    303.708.7248 |
| trip network, inc.                                 fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| http://www.cheaptickets.com/                   http://www.trip.com/ |

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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