我有一个类似以下XML文档的东西:::
<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="urn:schemas-microsoft-com:office:spreadsheet">
<Worksheet ss:Name="Worksheet1">
<Table>
<Column ss:Width="100"></Column>
<Row>
<Cell ss:Index="1" ss:StyleID="headerStyle">
<Data ss:Type="String">Submitted By</Data>
</Cell>
</Row>
<Row>
<Cell ss:Index="1" ss:StyleID="alternatingItemStyle">
<Data ss:Type="String">Value1-0</Data>
</Cell>
</Row>
</Table>
<AutoFilter xmlns="urn:schemas-microsoft-com:office:excel"
x:Range="R1C1:R1C5"></AutoFilter>
</Worksheet>
</Workbook>
选取行时的问题在于
<xsl:for-each select="//Row">
<xsl:copy-of select="."/>
</xsl:for-each>
不匹配。我移除了所有的命名空间,它就可以正常工作了。那么,我该如何让“select”与“Row”匹配呢?
*:local-name
仅在XSLT/XPath 2.0中有效。 - user357812<xsl:for-each select="ns1:foo|ns2:foo|ns3:foo">
。 - Tomalakxmlns:xhtml="http://www.w3.org/1999/xhtml"
并使用前缀,如select="xhtml:body"
。 - Tomalak