[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Swapping table rows and columns
<css:stylesheet xmlns:css="http://www.w3.org/XSL/Transform/1.0" xmlns="http://www.w3.org/TR/REC-html40" result-ns=""> <css:template match="table"> <table> <css:for-each select="tr[1]/td"> <tr> <css:variable name="n" expr="position()"/> <css:for-each select="//td[position()=$n]"> <td><css:apply-templates/></td> </css:for-each> </tr> </css:for-each> </table> </css:template> </css:stylesheet> the above turns <table> <tr> <td>11</td><td>12</td><td>13</td><td>14</td><td>15</td> </tr> <tr> <td>21</td><td>22</td><td>23</td><td>24</td><td>25</td> </tr> <tr> <td>31</td><td>32</td><td>33</td><td>34</td><td>35</td> </tr> </table> into <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <table> <tr> <td>11</td> <td>21</td> <td>31</td> </tr> <tr> <td>12</td> <td>22</td> <td>32</td> </tr> <tr> <td>13</td> <td>23</td> <td>33</td> </tr> <tr> <td>14</td> <td>24</td> <td>34</td> </tr> <tr> <td>15</td> <td>25</td> <td>35</td> </tr> </table> David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|