Using XSLT, how can I produce a table with elements at the position of the the node's attributes?

Posted by Dr. Sbaitso on Stack Overflow See other posts from Stack Overflow or by Dr. Sbaitso
Published on 2010-03-26T14:58:25Z Indexed on 2010/03/26 15:13 UTC
Read the original article Hit count: 157

Filed under:
|

Given the following XML:

<items>
    <item>
        <name>A</name>
        <address>0</address>
        <start>0</start>
        <size>2</size>
    </item>
    <item>
        <name>B</name>
        <address>1</address>
        <start>2</start>
        <size>4</size>
    </item>
    <item>
        <name>C</name>
        <address>2</address>
        <start>5</start>
        <size>2</size>
    </item>
</items>

I want to generate the following output including colspan's

+---------+------+------+------+------+------+------+------+------+
| Address | 7    | 6    | 5    | 4    | 3    | 2    | 1    | 0    |
+---------+------+------+------+------+------+------+------+------+
| 0       |      |      |      |      |      |      | A           |
+---------+------+------+------+------+------+------+------+------+
| 1       |      |      | B                         |      |      |
+---------+------+------+------+------+------+------+------+------+
| 2       |      | C           |      |      |      |      |      |
+---------+------+------+------+------+------+------+------+------+
| 3       |      |      |      |      |      |      |      |      |
+---------+------+------+------+------+------+------+------+------+

I think I would be able to accomplish this with a mutable xslt variable, but alas, there's no such thing.

Is it even possible? How?

© Stack Overflow or respective owner

Related posts about xslt

Related posts about xsl