xsl-list
[Top] [All Lists]

Re: [xsl] Boolean logic

2012-01-03 08:11:16
On 29/12/2011 14:48, davep wrote:
Select line:
   if n < 100 then 1
   if n < 200 then 2
   if n < 300 then 3
  etc.

isn't that bit just
n idiv 256 + 1
rather than a repeated 'if' test?

except that I'm confused as assuming a line position assumes that your array is a dense format with all lines present, but I suspect it isn't, so rather than a line number don't you just want to select a line with the appropriate base child, something like:

line[base = (n idiv 256)]

presumably things would be more efficient if you pre-processed the input array into some more amenable format, especially as xpath can't natively deal with integers written in hex?

David



________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

--~------------------------------------------------------------------
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>