[Home] [By Thread] [By Date] [Recent Entries]

Subject: RE: Problem with Xpath
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 13 Dec 2006 21:48:58 -0000
> Now, I have logic in my style sheet which says that only if 
> element <l1> contains element <info>,

> <xsl:template match="l1">
> <xsl:choose>
> 			<xsl:when test="//info">
> 				<xsl:if 
> test="//info/company=$company and //info/product=$product">
> 					<fo:list-block>
> 						<fo:list-item>
> 							

All those //info paths search the whole document. To search the subtree
starting at the context node, use .//info

If the info must be an immediate child of the context node use "./info" or
simply "info".

Michael Kay
http://www.saxonica.com/

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member