> Here is my stylesheet but I am missing something in my understanding. Thanks
in advance for your help.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:math="http://www.w3.org/2005/xpath-functions/math"
> exclude-result-prefixes="xs math"
> version="3.0" expand-text="yes">
>
> <xsl:output indent="yes"/>
>
> <xsl:template match="/pub">
> <xsl:copy>
> <xsl:apply-templates select="section"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="section">
> <entry><xsl:value-of select="title/descendant-or-self::* except
data"/></entry>
> </xsl:template>
>
> </xsl:stylesheet>
>
What you are missing is that `<xsl:value-of
select="title/descendant-or-self::* except data"/>` concatenates the string
values of all the selected elements, including the `title` element and the
`ph` element, and the string value of an element is the concatenation of all
its descendant text nodes.
I would recommend using the recursive descent approach using template rules.
However, an alternative would be
<xsl:value-of select="title/descendant::text() except title//data/text()"
separator=""/>
Michael Kay
Saxonica
|