xsl-list
[Top] [All Lists]

[xsl] Unique Nodes

2007-03-31 11:53:25
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>