<note>
<from>Example</from>
<heading>Reminder</heading>
<body>XSLT conversion</body>
</note>
輸出XML的預期。
<xml>
<data>
<column1>
<note>
<from>Example</from>
<heading>Reminder</heading>
<body>XSLT conversion</body>
</note>
</column1>
</data>
</xml>
當前XSLT我們使用,我們有一些問題,加載輸入。 (如果輸入是直接的XML,我們沒有任何問題複製它,它只有編碼的XML)。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<xml>
<data>
<column1>
<xsl:copy>
<xsl:copy-of select="/node()"/>
</xsl:copy>
</column1>
</data>
</xml>
</xsl:template>
</xsl:stylesheet>
謝謝,它根本沒有xml標記,所有這些('<','>')轉換爲&gt,&lt;但是這個XSLT代碼適用於普通的xml,而不是&gt;&lt; xml .. output.any幫助? – 2013-05-13 20:28:58
@ChristopherDavid:就目前而言,您的數據不是XML,因此無法使用XSLT進行處理。如果你所要做的只是把它包裝在'xml/data/column1'中,那麼就寫一個打印出來的程序。 – Borodin 2013-05-13 20:58:39