|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] opposite of preceding-sibling
hi all
i am in a xml structure like:
<test>
<result>
<row>
<artnr>gh</artnr>
<index>hk</index>
</row>
<row>
<artnr>gh</artnr>
<index>hk</index>
</row>
</result>
<test>
i want to compare the <artnr> .
i'd like to get an output in xml like this.
<test>
<list>
<col>
<artnr>
<index>
<index> if the artnr of the different rows are equal
<index>
</artnr>
</col>
<col>
<artnr>
<index> if the artnr are different theres only the current index
</artnr>
</col>
i am not able to access the <artnr> tag a second time to put in a new index.
<xsl:template match="row">
<xsl:if test="not(preceding-sibling::row[1]/artnr = artnr)">
<col>
<xsl:variable name="nummer" select="artnr"/>
<artnr nummer="{$nummer}">
<xsl:call-template name="row3"/>
</artnr>
</col>
</xsl:if>
<xsl:if test="(preceding-sibling::row[1]/artnr = artnr)">
<xsl:call-template name="row3"/>
</xsl:if>
<xsl:apply-templates mode="row1"/>
</xsl:template>
<xsl:template name="row3">
<Index>
<xsl:value-of select="index"/>
</Index>
<xsl:apply-templates mode="row1"/>
</xsl:template>
hopefully
jan
Jan Weiss
IT - Student
BCT Technology AG
Im Lossenfeld 9
D-77731 Willstaett
Tel: +49-7852-996-237
Fax:+49-7852-996-100
mailto:jweiss@xxxxxxxxxxxxxxxxxx
http://www.bct-technology.com
http://www.bct-portal.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








