Re: [xsl] Need help combing two elements

Subject: Re: [xsl] Need help combing two elements
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Fri, 27 Mar 2009 20:02:52 +0100
Fatbob schrieb:

Is it possible to combine two elements using XSL so that they display as one?

 <Cell longDate="1143122100140" ChangeContext="FID=50020"
 ShowLink="true" Status="Normal">Mar 23, 2006</Cell>
 <Cell ChangeContext="FID=50020" ShowLink="true"
 Status="Normal">08:44</Cell>

Assuming (a) your Cell/@longDate has all the information that is needed, (b) it can be converted to a UNIX timestamp and (c) you wouldn't mind using extension functions, you could call your XSLT from, say, Perl, register a suitable extension function and then call back from your XSLT into Perl passing Cell/@date as a string which you then have all the power of strftime() to format in any way you like.

http://search.cpan.org/perldoc?XML%3A%3ALibXSLT

Look for "register_function".

Michael Ludwig

Current Thread