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

Re: Compound filter in for-each

Subject: Re: Compound filter in for-each
From: "Alan Hale" <A.Hale@xxxxxxxxxx>
Date: Fri, 27 Mar 2009 17:31:26 +0000
Re:  Compound filter in for-each
>>> Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> 16:39 27 March 2009 >>>
Alan,

Right.

 From here, it's a short step to use a template (with Mike's correction):

<xsl:template match="Folder">
   <xsl:apply-templates select="Placemark[ExtendedData/Data
     [attribute::name='rdb_status' and value='Endangered']]"/>
   </xsl:template>

<xsl:template match="Placemark">
   <xsl:value-of select="@id" />,
   <xsl:value-of select="name" />,
   <xsl:value-of select="ExtendedData/Data[@name='location_name']/value"/>,
   <xsl:value-of select="ExtendedData/Data[@name='grid_ref']/value"/>,
   <xsl:value-of select="ExtendedData/Data[@name='rdb_status']/value"/>,
   <xsl:value-of select="ExtendedData/Data[@name='last_seen']/value"/>,
   <br/>
</xsl:template>

Now, this is an improvement only if:

(a) you consider it a cosmetic improvement, or
(b) your problem becomes more complex and you discover you have to do
the same thing with other Placemark elements in other situations.

More refactoring is also possible; for example you could have a
template matching 'Data' elements that would write their 'value'
elements, if you did a lot of that. But again, for a simple case
(especially if it's a single-purpose, one-off stylesheet) that might
be overkill, and you get the idea.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Ah yes, I get it - thanks again. I also looked today at the links you sent me
on push v. pull processing, which have helped clarify some of this further for
me.

This approach may not give me any immediate advantage but I will probably wish
to do a lot more processing of these type of data in the future so it's useful
to know what the options are (and to begin to understand them).

Cheers
Alan

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.