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

Re: selecting a node to concatenate

Subject: Re: selecting a node to concatenate
From: "Aaron Johnson" <artpunx@xxxxxxxxx>
Date: Fri, 5 Oct 2007 08:39:23 +0100
Re:  selecting a node to concatenate
Thanks Charles, that was really useful.

On 10/4/07, cknell@xxxxxxxxxx <cknell@xxxxxxxxxx> wrote:
> Assuming your concats and substrings are correct, you want to create a template to match "submissionDeadline" and apply the template from your stylesheet at the appropriate point.
>
> Replace $currentTime with ".", which represents the current node.
>
> <xsl:template match="submissionDeadline"><xsl:value-of select="concat(substring(., ,4),substring(.,6,2),substring(.,9,2),substring(.,12,2),substring (.,15,2),substring.,18,2))"/></xsl:template>
> --
> Charles Knell
> cknell@xxxxxxxxxx - email
>
>
>
> -----Original Message-----
> From:     Aaron Johnson <artpunx@xxxxxxxxx>
> Sent:     Thu, 4 Oct 2007 18:25:39 +0100
> To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:   selecting a node to concatenate
>
> I have a node in my XML which contains a date string. I want to
> concatenate it into an integer. I can do the concat part using
> substrings but can't work out how to select the node in the first
> instance!
>
> The XML looks like this...
>
> 2027-10-04T09:00:00.0000000-00:00</submissionDeadline>
>
> ..if I pass it to the stylesheet as a param or variable I can concatanate it...
>
> <xsl:variable name="currentTime">2007-10-04T09:00:00.0000000+01:00</xsl:variable>
> <xsl:variable name="currentTimeString"
> select="concat(substring($currentTime, 1,4),substring($currentTime,
> 6,2),substring($currentTime,
> 9,2),substring($currentTime,12,2),substring($currentTime,15,2),substring($currentTime,18,2))"/>
>
> .. to make it look like this...
>
> 20071004090000
>
> I need a way to select the <submissionDeadline> nodes content to get a
> similar result.
>
> Any ideas? Thanks for any suggestions...

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-2011 All Rights Reserved.