Subject: RE: [xsl] concatenated key From: "I-Lin Kuo" <ikuoikuo@xxxxxxxxxxx> Date: Wed, 23 Apr 2003 11:43:49 +0000 |
<xsl:if test="some $x in //node/@name satisfies ($x = $theseChildren)">
I-Lin Kuo, Ann Arbor, MI Macromedia Certified ColdFusion 5.0 Advanced Developer Sun Certified Java 2 Programmer Ann Arbor Java Users Group (http://www.aajug.org)
----Original Message Follows---- From: David.Pawson@xxxxxxxxxxx Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] concatenated key Date: Wed, 23 Apr 2003 09:06:42 +0100
> Given a node, I'm trying to identify/pull out those nodes in > the document > having the same set of identically named child nodes. For > example, given the > node Alpha in the following, I'd like to pull out the "Alpha2" node. > > <node name="Alpha"> > <node name="a"/> > <node name="b"/> > </node> > <node name="roman"> > <node name="i"/> > <node name="ii"/> > </node> > <node name="Alpha2"> > <node name="a"/> > <node name="b"/> > </node>
Beating Jeni to it for once :-) In xslt 2 this is
<xsl:template match="node"> <xsl:variable name="theseChildren" select="node/@name"/> <xsl:if test="some $x in ../node/node/@name satisfies ($x = $theseChildren)"> <xsl:variable name="this" select="generate-id()"/> (I am <xsl:value-of select="@name"/>) <xsl:for-each select="../node"> <xsl:if test="(node/@name = $theseChildren ) and not(generate-id() = $this)"> Match at <xsl:value-of select="position()"/> <br />
</xsl:if> </xsl:for-each> </xsl:if> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] concatenated key, David . Pawson | Thread | Re: [xsl] concatenated key, Jeni Tennison |
Re: [xsl] concatenated key, Jeni Tennison | Date | Re: [xsl] concatenated key, Jeni Tennison |
Month |