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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format