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

Re: Filtering the nodes passed to a template...

Subject: Re: Filtering the nodes passed to a template...
From: Mike Brown <mike@xxxxxxxx>
Date: Sat, 1 Apr 2000 04:23:15 -0700 (MST)
xsl coherent nodes
> Thanks for the reply Mike,
> I'm still having problems though...perhaps if I explain it more cleary...

Yes, cleary that would be of benefit :) :) :)

> ...So in the end, my output will look like this
> 
> PaymentType	Desc
> CASH		Cash
> CCDEBTOR	Amex
> 		Visa
> 		Diners
> CHEQUE	Cheque

Wait, do you want copies of output like the above for each id that has a
matching paymentTypeRef, or do you want one summarial output that looks
like that for the entire set of ids?

> <xsl:apply-templates select="paymentType[@paymentTypeRef =
> /report/payments/payment/@id]">
> 
> and in that template I use...
> 
>   <xsl:if test="@paymentTypeRef !=
> ../preceding-sibling::paymentType/@paymentTypeRef]">
>     <xsl:value-of select="@paymentTypeRef"/>
>   </xsl:if>
> 
> but this seems to reference the original XML and not the filtered XML which
> is passed into the template.  So I need a way of accessing and testing
> values in the filtered node set, and not the original.

Yes, you're always referencing the source tree. 

There are vendor-specific solutions for treating result tree fragments as
node-sets, but I don't think you really need it for this situation.
Unfortunately I am once again up too late and can't put together a
coherent block of code for you, but I'm sure it can be done in pure XSLT.

If I have time I'll work on it this weekend, but don't hold your breath :)

   - Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/    http://www.webb.net/


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


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.