[Home] [By Thread] [By Date] [Recent Entries]
At 03:05 20-07-2001, David Glover wrote:
I wish to return all brands/lines/items that have this @OFFER attribute. This is the confusing part. What do you mean by "return"? An XPath expression matches nodes. You could have an expression that matches the brands, or, lines, or items, or all of them, but it's not clear what the value of matching all of them would be. Now, if by "return" you mean "copy into the result tree", i.e. copy the source tree but prune any branches that don't have offers, then what you probably want to do is have a template that matches any BRAND with an offer on any descendant, and then only process the ITEMs with any offers, etc. <xsl:template match="BRAND[@OFFER]" priority="1"> If it is an ITEM I wish to return its parent LINE and grandparent BRAND as well. If it is a LINE, I wish to return its child ITEMs and parent BRAND as well. If it is BRAND I wish it to return its child LINEs and its grandchildren ITEMs. I DO NOT WANT any siblings of the matched element.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



