W
Wilson Wu
hi,
how can i use xslt to transform xml data into excel worksheet ?
XML file :
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test5.xsl"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata">
<Employees>
<EmployeeID>1</EmployeeID>
</Employees>
<Others>
<Name2>test</Name2>
</Others>
</dataroot>
XSLT file :
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput method="html"/>
<xsl:template match="/">
<TABLE>
<TR>
<TH>ID</TH>
</TR>
<xsl:apply-templates select="dataroot/Employees">
<xsl:sort select="LastName" order="ascending"/>
</xsl:apply-templates>
</TABLE>
</xsl:template>
<xsl:template match="dataroot/Employees">
<TR>
<TD>
<xsl:value-of select="ID" />
</TD>
</TR>
</xsl:template>
thanks
wilson
how can i use xslt to transform xml data into excel worksheet ?
XML file :
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test5.xsl"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata">
<Employees>
<EmployeeID>1</EmployeeID>
</Employees>
<Others>
<Name2>test</Name2>
</Others>
</dataroot>
XSLT file :
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput method="html"/>
<xsl:template match="/">
<TABLE>
<TR>
<TH>ID</TH>
</TR>
<xsl:apply-templates select="dataroot/Employees">
<xsl:sort select="LastName" order="ascending"/>
</xsl:apply-templates>
</TABLE>
</xsl:template>
<xsl:template match="dataroot/Employees">
<TR>
<TD>
<xsl:value-of select="ID" />
</TD>
</TR>
</xsl:template>
thanks
wilson