Hi David,
I'm guessing that you are new to XSL. To get the most out of it
requires a change of mind-set and, in my opinion, this requires
avoiding use of <xsl:for-each> until you get your head around the
declarative basis of XSLT.
That aside, to answer your question, what you have done is set the
document context to the first book element and then selected the child
axis only for that first book element.
You would be better off defining a template :-
<xsl:template match="chapter">
<xsl:value-of select="content"/>
</xsl:template>
and then triggering this by using
<xsl:apply-templates select="book"/>
from wherever you want/need to.
I hope this helps - if you persevere it will pay the same sort of
dividends as a true understanding of SQL.
Regards
David Simons <> wrote in message news:<cvj15s$vka$>...
> Hi,
>
> I don't know how to print out all subcontent of an
> element with xslt. E.g.
> <book>
> <chapter>first chapter
> <content>
> lorem ipsum bla
> </content>
> </chapter>
> <chapter>second chapter
> <content>
> that and this and this and that
> </content>
> </chapter>
> ......
> </book>
>
> xslt:
> ....
> <xsl:for-each select="book"> <xsl:value-of select="child::*"/>
> </xsl:for-each>
> ...
>
> But this just gives me the first chapter but none of
> the other chapters, I don't know why?
>
> Regards,
>
> David
|