On 15/12/2013, e-letter <inpost(_at_)gmail(_dot_)com> wrote:
...
<book category=3D"WEB">
<title lang=3D"en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
The stylesheet was edited to use the element conditional processing 'xsl:if':
...
<xsl:template
match="bookstore/book"
>
<p >
<xsl:template
match="author"
>
<xsl:apply-templates/>
<xsl:if
test="following-sibling::author">
,
</xsl:if>
<!--The following (from the specification
example section 8.1)
only works if the text to be separated by commas is contained within a
single element, i.e. multiple authors listed in a single element
'author'. Does not work if each author contained in single element, ie
<author>AB</author><author>CD</author>
<xsl:if
test="not(position()=last())">
,
</xsl:if>-->
</xsl:template>
<xsl:apply-templates
select='author'
/>
<!--<xsl:value-of
select="author"
/>-->
</p>
</xsl:template>
...
Why does the expression 'test="following-sibling::author"' fail?
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--