xsl-list
[Top] [All Lists]

[xsl] Newbie: Extracting and evaluating partial values from elements

2007-10-22 09:32:35
Hi all,

I'm trying to take 32-bit registers that have been documented as follows:

<?xml version="1.0" encoding="UTF-8"?>
<register>
    <bit_postion>31:12</bit_postion>
    <bit_postiont>11:9</bit_postion>
    <bit_postion>8</bit_postion>
    <bit_postion>7</bit_postion>
    <bit_postion>6:1</bit_postion>
    <bit_postion>0</bit_postion>
</register>

and turn them into a 32-column table where the number of bits in each 
<bit_position> element is popluated into the a colspan tag. This means that the 
first bit element would result in <td colspan="19">, the third bit_position 
element would result in <colspan='1'>, etc. 

Getting the values out of the single-entry elements is easy; if there's no 
colon, I know it only contains a single bit. Getting the values when there IS a 
colon is driving me nuts. I need to to extract the values, determine the 
difference, and populate the colspan, and XSL's handling of 
variables/parameters is very new and unfamiliar to me. Any pointers on a good 
approach would be much apprecitated; everything I've tried so far has ended up 
chasing its tail, logically speaking. 

I'm using Saxon 6.5.5, but would prefer to avoid using extensions if possible.

Thanks in advance for any guidance.

(Yes, I know that that could have been avoided by adding something like 
optional <high_value> and <low_value> elements to the <bit_position> element, 
but the horses left the barn on that one 6 years ago.)

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