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

Re: Passing sort criteria as a paramter

Subject: Re: Passing sort criteria as a paramter
From: "Gene LaCava" <e.f.lacava@xxxxxxxxxxx>
Date: Thu, 24 Jan 2002 19:25:44 -0500
passing parameter into criteria

Can you tell me how to post a question to this list server ? I have tried 3
times already with no luck...

Thank Yoou
----- Original Message -----
From: "Wendell Piez" <wapiez@xxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, January 24, 2002 4:56 PM
Subject: Re:  Passing sort criteria as a paramter

> David,
> I can't claim to be Jeni (well I could but no one would be fooled), but
> At 04:33 PM 1/24/02, you wrote:
> >I have been passing the sort element name into my xsl by way of a
> >parameter.  I then do this:
> >
> ><xsl:sort select="*[local-name() = $sortby"]">
> >
> >and this works great.  Now, I want to qualify the element name, such
> >that the select attribute would read
> >
> >select="Amount[../IsCredit=1]"
> >
> >if I wanted to just park the select attribute at one element.
> >
> >Now, how can I pass the above predicated element name into the
> >stylesheet?
> If you just mean to apply the predicate to a dynamic element name, you
> would use the same idiom:
> select="*[local-name()=$sortby][../IsCredit=1]"
> This translates into English as
> "sort by the values of the element children whose name equals $sortby and
> whose parents have a child 'IsCredit' element whose value equals 1"
> But if you need to pass the whole thing in, as in passing in the string
> "Amount[../IsCredit=1]", you're stuck, unless the pattern is regular
> to break it down into pieces and use the same value-testing trick
> (sometimes testing the value of the name) on each piece separately. But
> your example leads me to think that's unlikely to cover your case.
> Unfortunately you can't pass an XPath expression in as a parameter and
> expect it to be evaluated: if it's a string, it's a string, not an XPath
> expression. If the name testing workaround isn't enough, some processors
> have extension functions for this; or if you're really stuck an expression
> can be parameterized by having a stylesheet generate your stylesheet.
> Enjoy,
> Wendell
> ======================================================================
> Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc.                http://www.mulberrytech.com
> 17 West Jefferson Street                    Direct Phone: 301/315-9635
> Suite 207                                          Phone: 301/315-9631
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>    Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.