I have XML file. I want to copy it and remove these attributes: ExpandedColumnCount
, ExpandedRowCount
. How can I do it?
<Table ss:ExpandedColumnCount="7" ss:ExpandedRowCount="3" x:FullColumns="1"
x:FullRows="1" ss:DefaultRowHeight="15">
<Row ss:AutoFitHeight="0"/>
<Row ss:Index="3" ss:AutoFitHeight="0">
<Cell ss:Index="4"><Data ss:Type="String">c1</Data></Cell>
<Cell><Data ss:Type="String">c2</Data></Cell>
<Cell><Data ss:Type="String">c3</Data></Cell>
<Cell><Data ss:Type="String">c4</Data></Cell>
</Row>
</Table>
If I use this XSLT file I remove element Table
.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Table|@ExpandedColumnCount"/>
</xsl:stylesheet>
What I want:
<Table x:FullColumns="1" x:FullRows="1" ss:DefaultRowHeight="15">
<Row ss:AutoFitHeight="0"/>
<Row ss:Index="3" ss:AutoFitHeight="0">
<Cell ss:Index="4"><Data ss:Type="String">c1</Data></Cell>
<Cell><Data ss:Type="String">c2</Data></Cell>
<Cell><Data ss:Type="String">c3</Data></Cell>
<Cell><Data ss:Type="String">c4</Data></Cell>
</Row>
</Table>
What am I doing wrong?