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

Re: Ideas for creating quotation collection

Subject: Re: Ideas for creating quotation collection
From: Steffen Glückselig <glueckselig@xxxxxxxxx>
Date: Sun, 19 Sep 2004 08:28:49 +0200
quotation format
On Sat, 18 Sep 2004 20:30:30 -0400, Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> wrote:

How about posting some before and after code of exactly what you're looking for?
Right,

I have my quotations in a XML-file that looks like this:
<coll>
<quote>
<line>The man who does not read books has no advantage over the man that can not read them.</line>
<source>Mark Twain</source>
</quote>
</coll>


After the first pass it should be something like
<coll>
<quote category="Mark Twain">
<line>The man who does not read books has no advantage over the man that can not read them.</line>
<source>Mark Twain</source>
</quote>
</coll>


With this additional information in place I want to generate a XHTML-file like this:

[html-stuff snipped]
<h2 id="Mark_Twain>Mark Twain</h2>
<blockquote>
<p>The man who does not read books has no advantage over the man that can not read them.</p>
</blockquote>



That is, the second pass categorizes the quotations by author or content. I'd use
<xsl:template match="*[local-name()='quote']">
<xsl:element name="quote">
<xsl:choose>
<xsl:when test="contains(.,'Mark Twain')">
<xsl:attribute name="category">Mark Twain</xsl:attribute>
</xsl:when>


    </xsl:choose>
  </xsl:element>
</xsl:template>

And here is one of my problems: contains is case-sensitive. I'd like to catch all cases of case - ;-) - with one test. Is this possible?

Is my method of using two styles/two passes good, or is there another way?



thanks
Steffen

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.