Subject: [xsl] interesting? problem From: 林 子芯 <minikittygo@xxxxxxxxxxx> Date: Mon, 07 Jul 2003 18:16:22 +0000 |
Hi, Can anyone help me over this problem i had with a stylesheet. suppose i have an xml like this:
<xml> <path> <f> <i>1</i><t>1</t> </f> <f> <i>2</i><t>2</t> </f> <f> <i>3</i><t>3</t> </f> </path> <path> <f> <i>1</i><t>2</t> </f> <f> <i>2</i><t>1</t> </f> </path> <path> <f> <i>1</i><t>4</t> </f> <f> <i>3</i><t>3</t> </f> <f> <i>4</i><t>2</t> </f> </path> </xml>
what i want to find is a path node that contain i= 1 and t = 1 where i and t is in the same node (i.e. in the same f node) so the result i want from the above xml is: <xml> <path> <f> <i>1</i><t>1</t> </f> <f> <i>2</i><t>2</t> </f> <f> <i>3</i><t>3</t> </f> </path> </xml>
i know this will work if i go down to the bottom level and do something like this: ex. 2 <xsl:template match="xml"> <xsl:for-each select="path"> <xsl:for-each select ="f[i='1' and t='1']"> <xsl:copy-of select="../."/> </xsl:for-each> </xsl:for-each> </xsl:template>
regards Kit
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] an Xpath question - $tag/, Michael Kay | Thread | Re: [xsl] interesting? problem, G. Ken Holman |
[xsl] an Xpath question - $tag/$sub, Anil | Date | [xsl] sort with using document(), Fei Zheng |
Month |