是的,這裏的過程中,我看到它:
1)從您的Excel電子表格創建XML數據和架構文件。請參閱this reference.
2)將XML模式導入到客戶端Excel電子表格中。請參見this reference.
3)將客戶端Excel電子表格導出到XML數據文件。
4)在一舉運行在兩個文檔的轉換,基本上是:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common">
<xsl:variable name="mine" select="document(/path/to/your.xml)"/>
<xsl:variable name="client" select="document(/path/to/client.xml)"/>
<xsl:variable name="both">
<both>
<xsl:copy-of select="exsl:node-set($mine)/>
<xsl:copy-of select="exsl:node-set($client)/>
</both>
</xsl:variable>
<xsl:template match="exsl:node-set($both)/whatever>
<xsl:apply-templates/>
</xsl:template>
<!-- More templates here to do what you will with all the data,
whether it be copying, sorting first, or etc. -->
</xsl:stylesheet>
5)導入結果返回到您的Excel文檔。
這是相當裸露的,我還沒有這麼做,所以一些特定的步驟可能在Excel中的版本顛簸之後發生了變化。最後一步需要在轉換之外完成,因爲XSLT是非破壞性的(不修改輸入源文檔,但只輸出新的結果文檔)
此外,它使用XSLT擴展功能exsl:node-set )。根據你所使用的工具,即IE瀏覽器,你可能需要將其切換到MSXSL擴展版本。
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
和
msxsl:node-set()
分別
。
驚喜G。謝謝。我迫不及待地嘗試這個! – user1599325 2012-08-15 16:54:07