xsl-list
[Top] [All Lists]

RE: Is this possible with XSL?

2006-03-03 11:22:32
I am so glad you thought of this! I think it will work and be *much* easier 
than the complicated mess I was getting ready to make out of it.

Thanks so much,
Cindy Hunt

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Sent: Friday, March 03, 2006 12:06 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Is this possible with XSL?

It looks to me like

<xsl:variable name="ruler"
select="'----+----1----+----2----+----3----+----4....'"/>

<xsl:value-of select="substring($ruler, @startNum, (@endNum - @startNum + 1))"/>

Of course you can construct the ruler programmatically if you want to, but I 
don't see the point. 

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Cindy Hunt [mailto:Cindy(_dot_)Hunt(_at_)sas(_dot_)com]
Sent: 03 March 2006 16:46
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Is this possible with XSL?

Hi-

I am having to do a bit of difficult programming work in my stylesheet 
that I am trying to figure out if I can actually code this with XSL or 
if I should try to call a Java extension to do this instead. We have 
an empty element called <columnRuler> that has two attributes to 
denote the starting number and ending number of this ruler. This ends 
up generating a monospace sequence of characters. We sometimes use 
this above monspace code samples to denote what column something 
occurs in.

Here is what is looks like if the element looked like <columnRuler 
startNum="1" endNum="40"/>:
----+----1----+----2----+----3----+----4

Here is what is looks like if the element looked like <columnRuler 
startNum="20" endNum="53"/>:
2----+----3----+----4----+----5---

So the single digits (1-4 and 6-9) are represented by dashes, the 5s 
are reprensented by plusses, and the 10s places are represented by 
their 1st digit (1 for 10, 2 for 20, etc.). I don't believe that we 
would support anything over 100 since that would be hard to represent.

Does anyone know if this is possible to do with XSL?

Any suggestions appreciated,
Cindy Hunt



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>