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

Testing last character for bibliography output

Subject: Testing last character for bibliography output
From: Charles Muller <acmuller@xxxxxxx>
Date: Sun, 13 Jul 2003 20:54:55 +0900 (JST)
xslt last character
I am transforming a bibliography into HTML using MLA, Chicago, etc. formats,
where I want to have a period after the author, book title, etc. Sometimes
my data comes with the period already attached, and sometimes not, so I need
a way of using xsl:if to test if the last character is a period or not. I
guess, then, that I am looking for something like a "lastchar" variable in
XSLT, but so far I have not been able to find any examples of this sort of
case in my XSLT books or on the web.

A sample piece of the XSLT file area, just for the entity <title>is like this:

 <xsl:template match="title">
    <xsl:choose>
    <xsl:when test="ancestor::listBibl">
<xsl:choose>
<xsl:when test="@level='m'">
    <span style="font-style:italic">
      <xsl:apply-templates/>. </span>
</xsl:when>
<xsl:when test="@level='j'">
    <span style="font-style:italic">
      <xsl:apply-templates/>. 
    </span> 
</xsl:when>
<xsl:when test="@level='a'">
&quot;<xsl:apply-templates/>.&quot;
  </xsl:when>
<xsl:when test="@level='u'">
&quot;<xsl:apply-templates/>.&quot;
  </xsl:when>


Charles Muller



---------------------------
Charles Muller  <acmuller@xxxxxxx>
Faculty of Humanities,  Toyo Gakuen University
Digital Dictionary of Buddhism and CJKV-English Dictionary [http://www.acmuller.net]
H-Buddhism List Editor [http://www.h-net.org/~buddhism/]
Mobile Phone: 090-9310-1787

 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.