-2
我试图生成XSL一个excel文件出类拔萃,但xslo自动生成的xmlns名为模板节点的每一根元素属性: 在xsl:生成XSL问题
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
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:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<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" >
...
<xsl:call-template name="Styles"></xsl:call-template>
...
</Workbook>
</xsl:template>
<xsl:template name ="Styles">
<Styles >
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="m20452808">
<Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
ss:Color="#000000"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
ss:Color="#000000"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
ss:Color="#000000"/>
</Borders>
<Interior ss:Color="#FFFF00" ss:Pattern="Solid"/>
</Style>
</Styles>
</xsl:template>
输出:
<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">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<LastAuthor>Harold</LastAuthor>
<Created>2010-11-09T09:41:05Z</Created>
<LastSaved>2010-11-09T09:41:05Z</LastSaved>
<Version>11.5606</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>12780</WindowHeight>
<WindowWidth>18795</WindowWidth>
<WindowTopX>240</WindowTopX>
<WindowTopY>315</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles xmlns="">
问题:
<Styles xmlns="">
.....
任何想法?????
什么?你如何试图从xsl生成一个excel文件?你如何得到这个输出?看来你想从Excel生成的xsl生成xml文件到我这里...你能清楚吗? – Shikiryu 2010-11-09 14:38:53
我从xsl + xml生成xls – 2010-11-10 10:45:31