Subject: RE: [xsl] Maipulating text string data in XML file with XSL ?? From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Fri, 28 Sep 2001 13:48:22 +0100 |
> I want to do some simple manipulation of some data in an XML > file, however > because I don't have a lot of XSLT experience I not sure if I > can use it to > achieve what I want. > > Here is what a bit of data looks like in the XML file: > > <draw date="2001-9-26" value="3-14-15-17-19-47-(5)" > prizes="0,0,0,0,0" /> > > In the transformed document I want to change the presentation > of the 'date' > and the 'value' to be something like this: > > <date>Wednesday, 26 September 2001</date> > <numbers>03 14 15 17 19 47<numbers/> > <bonus>05</bonus> > You can do these things in XSLT, but the language isn't designed to make it especially easy, and you have to learn some new tricks. It's worth learning how to write recursive named templates to parse strings like these, you'll find a description of the technique in my "XSLT Programmer's Reference" or on any of the tutorial sites (look under xsl:call-template). If you want a short-cut, look at extension functions like "saxon:tokenize()". Sorry I don't have time to give you a fully worked solution, Mike Kay > Ross Kendall > Technical Developer > Affinity Internet Holdings And as a heavy user, let me compliment your company on its excellent ISP service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Maipulating text string d, Chris Bayes | Thread | Re: [xsl] Maipulating text string d, Paul Tyson |
[xsl] "<" output problems, c-i-e | Date | [xsl] RE: XSL-List Digest V3 #1132, Robert Stuart |
Month |