This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Testing the Content of the Next Node
- To: xsl-list at mulberrytech dot com
- Subject: Testing the Content of the Next Node
- From: Stewart Unwin <sunwin at nla dot gov dot au>
- Date: Fri, 10 Mar 2000 09:22:01 +1100
- Reply-To: xsl-list at mulberrytech dot com
I have an XML fragment :
<biblentry>
<title>The cat sat on the mat</title>
<body>/ David Jones</body>
</biblentry>
<biblentry>
<title>The fox jumped over the dog</title>
<body>Sydney : ABC Press, 1987</body>
</biblentry>
What I want to achieve is output like this :
The cat sat on the mat / David Jones
The fox jumped over the dog. Sydney : ABC Press, 1987
i.e., if the first character in the following element "body" is "/", add a
space to the end of title, otherwise add a fullstop/period and a space.
This template does not seem to work in Excelon's Stylus processor:
<xsl:template match="title">
<xsl:value-of select="."/>
<xsl:if test="starts-with(following-sibling::body,/)"> </xsl:if>
<xsl:if test="not(starts-with(following-sibling::body,/))">. </xsl:if>
</xsl:template>
Grateful for any advice.
Stewart Unwin
Web Services Branch
National Library of Australia
Tel: +61-2 6262 1544
Fax: +61-2 6273 3648
E-mail: sunwin@nla.gov.au
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list