This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Hexadecimal Arithmetic


Maulik -

It gets a little ugly, but what follows converts from hex to dec, does the
operation, then converts back.  As an aside, I've never had the need to look
before now, but I didn't find an operator for n to the x power (generally
n^x) ... am I missing it somewhere in the specs or does it actually not
exist?  If one exists, this can be slightly simplified by removing that
recursive template.  This would probably be quite a bit less verbose with a
hook into an extension function also, but until those are standardized in
1.1 I'll stick with this.

Hope this helps!

-Nate

>Date: Thu, 31 Aug 2000 09:45:05 -0500
>From: "Maulik Modi" <mxmodi@duke-energy.com>
>Subject: Hexadecimal Arithmetic
>
>Hi,
>
>I have the following snippet of my XML data:
><root>
><parent level="1">
><child1>some text</child1>
><child2>some more text</child2>
><parent>
><parent level="2">
><child1>text</child1>
><child2>different text</child2>
></parent>
>....
></root>
>
>I want to present this in a table and that's done. Now I want to color code
each
> table row depending on the value of the "level" attribute. That's done.
Now I
>want to give each row a different gradient of the same color depending on
the
>value of the "level". The value of the level ranges from 1-10. I wanted to
take
>this and use
>it with hexadecimal arithmetic. Does anyone know how?
>
>I am getting greedy now, but it would be really nice if I could do this
>dynamically as I foresee that my XML data will not be static.
>
>Any help is appreciated.
>
>Maulik


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]