[xsl] pairing up similar tags based on an attribute

Subject: [xsl] pairing up similar tags based on an attribute
From: Webmaster <Webmaster@xxxxxxxxxxx>
Date: Wed, 11 Oct 2006 20:37:05 -0500

My data (snippet) looks like this:

<spec partnumber="9300033" parentpn="9310079">

<spec partnumber="9300133" parentpn="9310079">

<spec partnumber="9300033" parentpn="9310023">

<spec partnumber="9300133" parentpn="9310023">

I'm trying to write a template that prints out each pair of 9300033 and
9300133 with the same @parentpn, but without luck:

<xsl:variable name="connectortype" >
<xsl:for-each select="spec[@partnumber=9300033]">
  <xsl:for-each select="./@parentpn">
		<xsl:value-of select="ancestor::spec/value" />
		<xsl:value-of select="ancestor::spec[@partnumber=9300133 and
@parentpn=.]/value" />

With this code, I'm getting the correct value for the 9300033, but I can't
seem to grab the corresponding 9300133 value.  I'm not quite sure if my
xpath is right. 

Any help would be very much appreciated!!!


Current Thread