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

Distinct list problem

Subject: Distinct list problem
From: Henk Meulekamp <henkm@xxxxxxx>
Date: Fri, 18 Jan 2002 14:53:12 +0100
xsl for each anchestor
Hi,

I'm trying to get a list of id's where each id is represented once out of
the xml below. Is it possible? The stylesheet below gives me:

20
21 - 20
21
20 - 21
22
21 - 22
20 - 22 - 21
21
20 - 21

So I get what I want, but then on anchestor based distinct. And not for all
attributequalitiy elements in the document. Should I make use of the msxml
nodeset function to construct a intermediate nodeset?

The ouput I want is:

20
21
22

Many thnx
Grt Henk Meulekamp


//-----------------------xsl

<xsl:variable name="attributes"
select="/root/page/ATTRIBUTES/CONTRACT//ATTRIBUTEQUALITY"/>

<xsl:for-each select="$attributes[not(@IDTESTTYPE =
preceding-sibling::ATTRIBUTEQUALITY/@IDTESTTYPE)]">
	    <br/>run -<xsl:value-of select="@IDTESTTYPE"/>
		<xsl:for-each select="preceding-sibling::ATTRIBUTEQUALITY">
			- <xsl:value-of select="@IDTESTTYPE"/>
		</xsl:for-each>	
</xsl:for-each>     

'//----------------------xml

<CONTRACT IDCONTRACT="2" CCONTRACTNUMBER="1.1" CPRODUCT="JORISTEST"
DECQUANTITY="1000.000" CUNIT="MT"> 
<DELIVERY IDDELIVERY="1" NUMLOADINGASSIGNMENT="1" IDTESTREPORT="2">
  <ATTRIBUTEQUALITY IDTESTTYPE="20" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="21" /> 
  </DELIVERY>
<DELIVERY IDDELIVERY="2" NUMLOADINGASSIGNMENT="1234" IDTESTREPORT="1">
  <ATTRIBUTEQUALITY IDTESTTYPE="21" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="20" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="21" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="21" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="20" /> 
  </DELIVERY>
<DELIVERY IDDELIVERY="4" NUMLOADINGASSIGNMENT="4" IDTESTREPORT="20">
  <ATTRIBUTEQUALITY IDTESTTYPE="22" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="21" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="20" /> 
  </DELIVERY>
<DELIVERY IDDELIVERY="6" NUMLOADINGASSIGNMENT="6" IDTESTREPORT="23">
  <ATTRIBUTEQUALITY IDTESTTYPE="21" /> 
  <ATTRIBUTEQUALITY IDTESTTYPE="20" /> 
  </DELIVERY>
</CONTRACT>

 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.