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

Re: nested output

Subject: Re: nested output
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Tue, 21 Dec 2004 11:37:00 -0500
xslt nested if
On Dec 21, 2004, at 11:12 AM, David Carlisle wrote:

?? the result you posted had no latex markup at all

oops :-)


(and does have a couple of strange characters (octal 226, decimal 150)
just after each page number, is that intended to be a dash of some
sort?

It displays fine in my mail program as an en-dash. I don't intend to deal with tex-escaping and such; just utf-8.

something like

   <xsl:template match="xhtml:span" mode="output-latex">
     <xsl:variable name="c" select="tokenize(@class, ' +')">

         <xsl:if test="$c='italic'">\textit{</xsl:if>
         <xsl:if test="$c='bold'">\textbf{</xsl:if>

<xsl:apply-templates/>

         <xsl:if test="$c='italic'">}</xsl:if>
         <xsl:if test=".='bold'">}</xsl:if>
 </xsl:template>

OK, thanks! Had a feeling it was easier than I was thinking!


David, you have background in TeX.  Do you have any thoughts about the
best design approach to this intermediate (xhtml) representation to
make output transformation to other targets easiest?

The basic options are:

1) Keep as is:

<span class="title bold italic">Riots and Pogroms</span>

2)  Split presentation from semantics, and embed the former in the
element; like:

	<span class="title" style="font-weight: bold; font-style:
italic;">Riots and Pogroms</span>

The latter approach would require some rethinking of the code.  Current
templates look like:


<xsl:template match="mods:titleInfo[not(@type='abbreviated')]" mode="full"> <xsl:param name="prefix" /> <xsl:param name="suffix" /> <xsl:param name="font-style" /> <xsl:param name="font-weight" /> <xsl:value-of select="$prefix" /> <xsl:choose> <xsl:when test="../../bib:refclass='part-inSerial' and not(../../mods:name)" /> <xsl:otherwise> <span class="title {$font-style} {$font-weight}"> <xsl:apply-templates select="mods:title" /> <xsl:apply-templates select="mods:subTitle" /> </span> <xsl:value-of select="$suffix" /> </xsl:otherwise> </xsl:choose> </xsl:template>

Perhaps a bib:style() function?

Incidentally, I'm realizing that XSLT 2.0's unparsed-text() functions
and reg-exp support means that this could theoretically be extended to
handle TeX input documents.

Bruce

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.