[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: xhtml via xslt failure


Subject: [xsl] Re: xhtml via xslt failure
From: e-letter <inpost@xxxxxxxxx>
Date: Tue, 17 Dec 2013 15:06:27 +0000

On 15/12/2013, e-letter <inpost@xxxxxxxxx> 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?


Current Thread