2012-10-04 2 views
1

이 내 Excel.xsl 파일은 asp.net에서 Excel로 XML을 변환하는 데 사용하고 있습니다. 그것은 잘 작동하지만 열 이름을 표시하고 싶지 않아요. 내 Excel 출력에 열 이름이 표시되지 않도록이 파일에서 무엇을 변경해야합니까?xslt asp.net에서 열 이름없이 변환을 Excel에서

<xsl:stylesheet version="1.0" 
    xmlns="urn:schemas-microsoft-com:office:spreadsheet" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
    xmlns:user="urn:my-scripts" 
    xmlns:o="urn:schemas-microsoft-com:office:office" 
    xmlns:x="urn:schemas-microsoft-com:office:excel" 
    xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" > 

    <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:apply-templates/> 
    </Workbook> 
    </xsl:template> 


    <xsl:template match="/*"> 
    <Worksheet> 
    <xsl:attribute name="ss:Name"> 
    <xsl:value-of select="local-name(/*/*)"/> 
    </xsl:attribute> 
    <Table x:FullColumns="1" x:FullRows="1"> 
     <Row> 
     <xsl:for-each select="*[position() = 1]/*"> 
     <Cell><Data ss:Type="String"> 
     <xsl:value-of select="local-name()"/> 
     </Data></Cell> 
    </xsl:for-each> 
    </Row> 
    <xsl:apply-templates/> 
    </Table> 
    </Worksheet> 
    </xsl:template> 


    <xsl:template match="/*/*"> 
    <Row> 
     <xsl:apply-templates/> 
    </Row> 
    </xsl:template> 


    <xsl:template match="/*/*/*"> 
    <Cell><Data ss:Type="String"> 
    <xsl:value-of select="."/> 
    </Data></Cell> 
    </xsl:template> 


    </xsl:stylesheet> 

답변

0

나는 파일을 바로 엑셀에서 제목 제거하려면이 코드를 주석 솔루션을 세례반

<!--<Row> 
     This code is to print the header. 
     <xsl:for-each select="*[position() = 1]/*"> 
     <Cell><Data ss:Type="String"> 
     <xsl:value-of select="local-name()"/> 
     </Data></Cell> 
    </xsl:for-each> 
    </Row>--> 
관련 문제