|
Subject: RE: [xsl] First Occurance Problem From: "Michael Kay" <mhk@xxxxxxxxx> Date: Mon, 24 Mar 2003 17:54:40 -0000 |
<xsl:template match="agg1">
<agg1>
<agg2>
<tagx><xsl:value-of select="(.//tag1)[1]"/></tagx>
</
</
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Deepak Rao
> Sent: 24 March 2003 16:57
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] First Occurance Problem
>
>
> Hi,
>
> Pl pardon my ignorance if this turns out to be a FAQ
> question. I tried to
> search biglist.com, to no avail.
>
> I have the following template
>
> <agg1>
> <agg2> <----Can repeat 1 to N times
> <tag1></tag1> <----Both tag1 and tag2 can be empty
> <tag2></tag2>
> </agg2>
> </agg1>
>
> Problem:
>
> I want to return a xml with the following template
>
> <agg1>
> <agg2> <----Can occur only once
> <tagx></tagx> <----tag1 will have the value from the first
> populated occurance of tag1 in the
> source xml
> </agg2>
> </agg1>
>
> The sample source xml is
>
> <agg1>
> <agg2>
> <tag2>value tag2-1</tag2>
> </agg2>
> <agg2>
> <tag1>value tag1</tag1>
> </agg2>
> <agg2>
> <tag2>value tag2-2</tag2>
> </agg2>
> </agg1>
>
> And the expected output is
>
> <agg1>
> <agg2>
> <tagx>value tag1</tagx>
> </agg2>
> </agg1>
>
> I tried using templated and even the for-each loop, to no avail.
>
> Can someone help me out.
>
> Thanks,
> Deepak
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] First Occurance Problem, Jeni Tennison | Thread | [xsl] apply-templates and XHTML's <, Gan Uesli Starling |
| Re: [xsl] First Occurance Problem, David Carlisle | Date | [xsl] apply-templates and XHTML's <, Gan Uesli Starling |
| Month |