[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Testing the Content of the Next Node

Subject: Testing the Content of the Next Node
From: Stewart Unwin <sunwin@xxxxxxxxxx>
Date: Fri, 10 Mar 2000 09:22:01 +1100
stewart unwin
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@xxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.