Given this Open XML snippet:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Sheet5">
<Table ss:ExpandedColumnCount="7" ss:ExpandedRowCount="4">
<Column ss:Index="2" ss:AutoFitWidth="0" ss:Width="59.25"/>
<Column ss:Index="5" ss:AutoFitWidth="0" ss:Width="75"/>
<Column ss:AutoFitWidth="0" ss:Width="31.5"/>
</Table>
</Worksheet>
</Workbook>
...what XSLT 1.0 templating solution (avoiding loops if possible) can I use to produce this HTML output snippet:
<table>
<colgroup>
<col style="width:45pt;">
<col style="width:59.25pt;">
<col style="width:45pt;">
<col style="width:45pt;">
<col style="width:75pt;">
<col style="width:31.5pt;">
<col style="width:45pt;">
</colgroup>
</table>
Note that the ss:ExpandedColumnCount attribute specifies the total number of columns. Also note that a Column tag in the source that does not include an ss:Index is a special case that specifies the next column index after the previous index; in this case, it evaluates to 6. All other columns assume the width of 45pt.
In my environment, there is no choice but to use the MSXML2 Engine.
This is just an arbitrary example of a range selection on an MS Excel worksheet encoded in Open XML, sometimes referred to as OOXML. I am looking for the XLST to perform this transformation in the general case.
75ptcome from?xsl:for-each, but this is more a mapping expression than a loop known in procedural languages.