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 |
- Problem with Xpath
- ms - 13 Dec 2006 18:39:29 -0000
- <Possible follow-ups>
- cknell - 13 Dec 2006 19:06:07 -0000
- ms - 13 Dec 2006 20:48:58 -0000
- cknell - 13 Dec 2006 21:00:40 -0000
- ms - 13 Dec 2006 22:13:34 -0000
|
|