2
我需要從我的xml文件中複製所有信息(實際上我需要將新的信息添加到我的xml文件中)。錯誤的xsl:副本輸出
我用非標準模板:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
,我寫測試XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE products SYSTEM "products.dtd" >
<?xml-stylesheet type="text/xsl" href="../xsl/copy.xsl"?>
<products>
<category name="Audio And Video">
<subcategory name="Audio">
<good>
<producer>Dell</producer>
<model>QQ678</model>
<color>White</color>
<date_of_issue>12-12-2012</date_of_issue>
<not_in_stock>true</not_in_stock>
</good>
</subcategory>
<subcategory name="Video">
<good>
<producer>Samsung</producer>
<model>VH500</model>
<color>Black</color>
<date_of_issue>12-12-2006</date_of_issue>
<price>200</price>
</good>
<good>
<producer>Toshiba</producer>
<model>GP436</model>
<color>White</color>
<date_of_issue>12-12-2004</date_of_issue>
<not_in_stock>true</not_in_stock>
</good>
</subcategory>
</category>
<category name="Computers">
<subcategory name="Pocket">
<good>
<producer>HP</producer>
<model>rx371</model>
<color>Black</color>
<date_of_issue>31-01-2006</date_of_issue>
<not_in_stock>true</not_in_stock>
</good>
</subcategory>
</category>
</products>
當我在瀏覽器中打開該XML文件,我想我會看到相同的XML文件,但它顯示我:
所以我犯了錯誤。請幫我解決我的問題
但我想複製我所有的xml文件,然後在它的許多網站上添加一些信息 –
我看到這個模板複製所有節點到結果文件的信息 –
爲什麼輸出看起來像這樣。沒有標籤 –