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

Re: Distinct values with XPath query in stylesheet

Subject: Re: Distinct values with XPath query in stylesheet
From: "Matthew Hailstone" <matthew.hailstone@xxxxxxxxx>
Date: Tue, 16 Sep 2008 12:32:15 -0600
Re:  Distinct values with XPath query in stylesheet
Thanks for the tidbit. I will definitely remember that little handy function. :)

After creating my test.xml and looking at the XPath query with
different node names, I did some more testing and found a solution for
XPath 1.0.

The XPath in the fee-type-defs template is:
//RECORDABLE_DOCUMENT/FEES/FEE[@Description=$feeName and
not(@*[name()=$feeValueAttr]=parent::node()/parent::node()/preceding-sibling::node()/FEES/FEE[@Description=$feeName]/@*[name()=$feeValueAttr])]

I also modified the XPath query in the sort-Fees template:
FEES/FEE[not(@Description=parent::node()/parent::node()/preceding-sibling::node()/FEES/FEE/@Description)]

I wasn't taking into consideration the parent structure being so far back. :)

Thanks again!
Matthew

On Tue, Sep 16, 2008 at 11:58 AM, Ryan Graham <Ryan.Graham@xxxxxxxxxxx> wrote:
>
>
> Are you locked into using 1.0? In 2.0, you could use:
>
> distinct-values(//FEE[@Description = 'Fee Two']/@Amount)
>
> HTH,
> Ryan
>
> This message is private and confidential. If you have received it in error, please notify the sender and remove it from your system.

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.