我在w3schools上了解了XSLT和XPath,但它不完全是我想要的。 只有關於轉換XSLT 2 HTML的示例,這很簡單,但我需要XML 2 XML轉換並找不到示例的好教程...我下載了MSXSL.exe,但無法找到使用它來轉換XML的示例... 任何人都可以寫一個示例嗎? 我有customers.xml喜歡:XML 2使用XSLT的XML
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--Customers table from Northwind database-->
<Customers>
<Customer CustomerID="ALFKI">
<CompanyName>Alfreds Futterkiste</CompanyName>
<Country>Germany</Country>
<Orders>
<Order OrderID="10643">
<ShipCity>Berlin</ShipCity>
</Order>
<Order OrderID="10692">
<ShipCity>Berlin</ShipCity>
</Order>
<Order OrderID="10702">
<ShipCity>Berlin</ShipCity>
</Order>
<Order OrderID="10835">
<ShipCity>Berlin</ShipCity>
</Order>
<Order OrderID="10952">
<ShipCity>Berlin</ShipCity>
</Order>
<Order OrderID="11011">
<ShipCity>Berlin</ShipCity>
</Order>
</Orders>
</Customer>
<Customer CustomerID="ANATR">
<CompanyName>Ana Trujillo Emparedados y helados</CompanyName>
<Country>Mexico</Country>
<Orders>
<Order OrderID="10308">
<ShipCity>México D.F.</ShipCity>
</Order>
<Order OrderID="10625">
<ShipCity>México D.F.</ShipCity>
</Order>
<Order OrderID="10759">
<ShipCity>México D.F.</ShipCity>
</Order>
<Order OrderID="10926">
<ShipCity>México D.F.</ShipCity>
</Order>
</Orders>
</Customer>
</Customers>
,並試圖生成一個只包含「國家」節點.. 怎麼寫另一個XML?
問得好,+1。看到我的答案兩種解決方案。 :) – 2010-10-20 13:25:50