我已經創建了一個應用程序來創建一個xsl和xml文件,但是輸出結果並沒有顯示爲XML佈局(如預期的HTML表格)。輸出在Internet Explorer中沒有顯示爲XML表格
要在xml或xsl文件中進行什麼更改才能使輸出看起來像HTML表格一樣?
我檢查了各種瀏覽器,但都顯示下面的輸出(邊緣)或根本沒有輸出。
中的XML文件(newfile_output.xml)具有含量:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl"
href="C:\Users\Michel\Documents\newfile_output.xsl"?>
<patch_list xml:lang="en">
<patch>
<type>Program</type>
<id>I-B000</id>
<name>Jazz Dry/Amb1 Kit SL1,2</name>
<favorite> </favorite>
<category>Drums</category>
<subcategory>Natural Drums</subcategory>
<setlistname></setlistname>
<setlistslotreferenceid></setlistslotreferenceid>
<setlistslotreferencename></setlistslotreferencename>
<description></description>
</patch>
....
<patch>
<type>WaveSequence</type>
<id>U-F012</id>
<name>Looped Cello G Vibrato</name>
<favorite> </favorite>
<category></category>
<subcategory></subcategory>
<setlistname></setlistname>
<setlistslotreferenceid></setlistslotreferenceid>
<setlistslotreferencename></setlistslotreferencename>
<description></description>
</patch>
</patch_list>
XSL文件(newfile_output.xsl)具有以下內容:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Patch List</h2>
<table border="1">
<tr bgcolor="#80a0ff">
<th>ListSubType</th>
<th>Id</th>
<th>Name</th>
<th>Fav</th>
<th>Category</th>
<th>Sub Category</th>
<th>Set List Slot Reference Id</th>
<th>Set List Slot Reference Name</th>
<th>Set List Name</th>
<th>Description</th>
</tr>
<xsl:for-each select="patch_list/patch">
<tr>
<td><xsl:value-of select="type"/></td>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="favorite"/></td>
<td><xsl:value-of select="category"/></td>
<td><xsl:value-of select="subcategory"/></td>
<td><xsl:value-of select="setlistslotreferenceid"/></td>
<td><xsl:value-of select="setlistslotreferencename"/></td>
<td><xsl:value-of select="setlistname"/></td>
<td><xsl:value-of select="description"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
的輸出如下所示:
Program I-A000 KRONOS German Grand Keyboard A.Piano Program I-A001 German
Dark Grand Keyboard A.Piano Program I-A002 R.Ferrante German Grand Keyboard
A.Piano Program I-A003 German New Age Grand Keyboard A.Piano Program I-A004
L.Mays German Grand Keyboard A.Piano Program I-A005 German Grand + VPM
Keyboard A.Piano Program I-A006 KRONOS Japanese Grand Keyboard A.Piano
Program I-A007 Japanese ...
'href =「C:\ Users \ Michel \ Documents \ newfile_output.xsl」'不是一個合適的URL。製作一個合適的網址。 – Tomalak