RE: [xsl] Problem with Xpath

Subject: RE: [xsl] 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
  • [xsl] Problem with Xpath
    • ms - Wed, 13 Dec 2006 10:39:01 -0800 (PST)
      • <Possible follow-ups>
      • cknell - Wed, 13 Dec 2006 14:05:49 -0500
        • ms - Wed, 13 Dec 2006 11:45:34 -0800 (PST)
      • cknell - Wed, 13 Dec 2006 15:56:05 -0500
        • ms - Wed, 13 Dec 2006 14:10:28 -0800 (PST)