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

Unique Nodes

Subject: Unique Nodes
From: Karthik <ckkarthik@xxxxxxxxx>
Date: Sat, 31 Mar 2007 14:53:04 -0400
 Unique Nodes
HI,

I am new to XSLT.
I have to grab the unique Products from the Input below using XSLT 1.0

INPUT:

<Proposal>
      <Quote>
      <QuoteId>1</QuoteId>
              <Products>
                      <Product>
                              <ProdID>
                                      1234
                              </ProdID>
                              <ProdID>
                                      5678
                              </ProdID>
                      </Product>
              </Products>
      </Quote>
      <Quote>
      <QuoteId>2</QuoteId>
              <Products>
                      <Product>
                              <ProdID>
                                      1234
                              </ProdID>
                              <ProdID>
                                      5678
                              </ProdID>
                      </Product>
              </Products>
      </Quote>
</Proposal>

Desired OUTPUT:

<Proposal>
      <Products>
              <ProdId>1234</ProdId>
              <ProdId>5678</ProdId>
      </Products>
</Proposal>


The code which I am trying is


<xsl:variable name="unique-Product"
select="//Proposal/Quote/Products/Product[not(ProductId=ancestor::Product/ProductId)]"/>

      <xsl:for-each select="$unique-Product">
      </xsl:for-each>

Any help is appreciated

Thanks in advance
Karthik

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.