-3
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="vehicles.xsl"?>
<!-- File Name : vehicles.xml -->
<data>
<params>
<returned_page>1</returned_page>
<total_pages>6</total_pages>
<items_count>56</items_count>
<previous_page></previous_page>
<next_page>2</next_page>
</params>
<grid>
<row>
<car_id>1</car_id>
<car_name>Audi A1</car_name>
<car_price_per_day>75.33</car_price_per_day >
<car_availability>1</car_availability>
</row>
<row>
<car_id>2</car_id>
<car_name>IQ 30</car_name>
<car_price_per_day>45.99</car_price_per_day >
<car_availability>1</car_availability>
</row>
<row>
<car_id>3</car_id>
<car_name>BMW 320</car_name>
<car_price_per_day>86.44</car_price_per_day >
<car_availability>0</car_availability>
</row>
<row>
<car_id>4</car_id>
<car_name>Ford Fiesta</car_name>
<car_price_per_day >54.68</car_price_per_day>
<car_availability>0</car_availability>
</row>
<row>
<car_id>5</car_id>
<car_name>Volkswagen Scirocco</car_name>
<car_price_per_day >65.99</car_price_per_day >
<car_available >0</car_available >
</row>
</grid>
</data>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="htp://www.w3.org/1999/XSL/Transform">
<!-- File Name : vehicles.xsl -->
<xsl:template match="/">
<html>
<body>
<h2>CARS</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>ID</th>
<th>Name</th>
<th>Price/Day</th>
<th>Availability</th>
</tr>
<xsl:for-each select="row">
<tr>
<td>
<xsl:value-of select="car_id"/>
</td>
<td>
<xsl:value-of select="car_name"/>
</td>
<td>
<xsl:value-of select="car_price_per_day"/>
</td>
<td>
<xsl:value-of select="car_availability"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
沒有我的探險者打開stylesheet..cant發現什麼不對的地方我想另一種編碼,完整路徑「價值的選擇」的命令,「數據」和「行」爲模板匹配但輸出相同。 我已經試過即mozila火狐和谷歌Chrome 鉻給了我一個空白頁,即單行和Firefox xml文件「錯誤加載樣式表:解析XSLT樣式表失敗」 有什麼想法?XML - XSL樣式表的問題
u的右我忘了改樣式表結束標記改造..但再次與這兩個標籤的樣式表或轉換同樣的問題,我有 – user1501764
別人????? – user1501764
非常感謝您的幫助,但還是同樣的問題-.-我試圖完整路徑匹配,價值的,換每個命令 – user1501764