[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

opposite of preceding-sibling

Subject: opposite of preceding-sibling
From: "Jan Weiss" <jweiss@xxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Aug 2001 14:47:23 +0200
opposite of preceding
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.