This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Testing the Content of the Next Node


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]