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

Keys and select distinct - is that the solution ?

Subject: Keys and select distinct - is that the solution ?
From: "Christian Rasmussen" <christiankrasmussen@xxxxxxxxx>
Date: Fri, 2 Jun 2006 23:55:48 +0200
select distinct on
Hi experts,

I've been struggling with a problem for several hours now, and I
cannot find the solution:
I have an XML document with a elements grouped in elements and
ManureTypeCodes and datavalues as siblings.
Then I have - somewhere else - in the document lookup information
(labels) for the codes.
These are grouped in elements of ManureTypeCodes and ManureTypeNames

I want to create a template rule which matches the codes and looks up
the corresponding name and ONLY writes the
ManureTypeName out once! In RDBMS I would use something like select
distinct when selecting the codes, but I dont know what the right
approach is in XSLT.

can someone please help.... on before hand thank you!

my XML:
<eih>
   <!-- Codes and data  -->
   <eih:ManureTypeCollection>
       <eih:ManureTypeStructure>
           <gr:ManureTypeCode>5</gr:ManureTypeCode>
           <gr:ElementIdentifier>N</gr:ElementIdentifier>
           <gr:ElementQuantity>17.0</gr:ElementQuantity>
       </eih:ManureTypeStructure>
       <eih:ManureTypeStructure>
           <gr:ManureTypeCode>5</gr:ManureTypeCode>
           <gr:ElementIdentifier>P</gr:ElementIdentifier>
           <gr:ElementQuantity>0.6</gr:ElementQuantity>
       </eih:ManureTypeStructure>
       <eih:ManureTypeStructure>
           <gr:ManureTypeCode>4</gr:ManureTypeCode>
           <gr:ElementIdentifier>N</gr:ElementIdentifier>
           <gr:ElementQuantity>17.5</gr:ElementQuantity>
       </eih:ManureTypeStructure>
       <eih:ManureTypeStructure>
           <gr:ManureTypeCode>4</gr:ManureTypeCode>
           <gr:ElementIdentifier>P</gr:ElementIdentifier>
           <gr:ElementQuantity> 6.3</gr:ElementQuantity>
       </eih:ManureTypeStructure>
   </eih:ManureTypeCollection>

   <!-- look up information for the codes -->
   <eih:XImanureTypeCollection>
       <eih:XImanureTypeStructure>
           <gr:ManureTypeCode>4</gr:ManureTypeCode>
           <gr:ManureTypeName>Fast gxdning</gr:ManureTypeName>
       </eih:XImanureTypeStructure>
       <eih:XImanureTypeStructure>
           <gr:ManureTypeCode>5</gr:ManureTypeCode>
           <gr:ManureTypeName>Ajle</gr:ManureTypeName>
       </eih:XImanureTypeStructure>
       <eih:XImanureTypeStructure>
   </eih:XImanureTypeCollection>
</eih>


best regards,


Christian Rasmussen
Denmark

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.