This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XPath question
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: XPath question
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Thu, 11 May 2000 13:32:50 +0100
- Reply-To: xsl-list at mulberrytech dot com
> <div type="introduction">
> <head>Introduction</head>
> <pb/>
>
> <div type="partie">
> <p>Test
> </p>
> <pb/>
> </div>
>
> </div>
>
> <xsl:template div[@type='introduction']">
> <xsl:for-each select="./*/pb">
> Find pb
> </xsl:for-each>
> </xsl:template>
>
> Why xt find only one pb.
Because there is only one <pb> element that is a grandchild of <div
type="introduction">, the other one is an immediate child. If you want to
find all descendant <pb> elements, write <xsl:for-each
select="descendant::pb">, or ".//pb" (which means the same thing unless
there are positional predicates). If you want to find children and
grandchildren, write "pb | */pb".
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list