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

Re: Re: Re: How can I translate a single letter into a

Subject: Re: Re: Re: How can I translate a single letter into a letter inside an element?
From: Chris Loschen <loschen@xxxxxxxxxxxxx>
Date: Tue, 18 Feb 2003 17:13:17 -0500
how can i translate
Thanks again!

I'm still not entirely sure what I was doing wrong, but in the process of trying to remove all
of the extraneous material, suddenly the code started working properly. No doubt that's
a good reason to ask for someone debugging to provide such a sample :-). I had to make
some other adjustments, but the following does seem to be doing what I had hoped:


<xsl:variable name="vCaps" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789;:!?'" />

<myMark:myMark />
<xsl:template match="myMark:*">
<xsl:param name="arg1" />
<xsl:choose>
<xsl:when test="contains($vCaps, $arg1)">
<span class="fullsize"><xsl:value-of select="$arg1" /></span>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="translate($arg1,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template match="sc">
<xsl:variable name="vCapsSpanned">
<xsl:call-template name="str-map">
<xsl:with-param name="pFun" select="document('')/*/myMark:*[1]" />
<xsl:with-param name="pStr" select="./text()" />
</xsl:call-template>
</xsl:variable>
<span class="smallcap"><xsl:copy-of select="$vCapsSpanned" /></span>
</xsl:template>


Input like

<sc>DPhil</sc> <sc>figure 1</sc>

is output as

<span class="smallcap"><span class="fullsize">D</span><span class="fullsize">P</span>HIL</sc> <sc>FIGURE <span class="fullsize">1</span></sc>

Hooray! Thank you very much for your help.


At 04:13 PM 2/18/03, you wrote:
Hi Chris,

"Chris Loschen" <loschen@xxxxxxxxxxxxx> wrote in message
news:5.2.0.9.0.20030218150914.00a2d990@xxxxxxxxxxxxxxxxxxxxx
> Hi, Dimitre!
>
> Thank you very much for the pointer. I've downloaded the FXSL scripts for
> Xalan, which is what I'm using,
> and I've tried to change the code in the example you cite so that it does
> what I'm hoping to accomplish.
> However, I seem to be doing something wrong, because I'm getting a java
> "Out of Memory" error.
>
> Here's the relevant portion of my spreadsheet:

The code seems OK, but this is just a portion.

Could you, please, provide a complete (but simplified and minimal) example
that still demonstrates the problem?

How long is the string you're processing and how many replacements must be
made?


===== Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




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

--Chris


----------------------------------------------------------------------------------------
Texterity ~ XML and PDF ePublishing Services
----------------------------------------------------------------------------------------
Chris Loschen, XML Developer
Texterity, Inc.
144 Turnpike Road
Southborough, MA 01772 USA
tel: +1.508.804.3033
fax: +1.508.804.3110
email: loschen@xxxxxxxxxxxxx
http://www.texterity.com/



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.