所以我给了两个XML文件,categories.xml和products.xml, 使用以下格式:
Categories.xml
<CategoriesRoot>
<Categories>
<CategoryID>1</CategoryID>
<CategoryName></CategoryName>
<Description></Description>
</Categories>
<Categories>
<CategoryID>2</CategoryID>
<CategoryName></CategoryName>
<Description></Description>
</Categories>
</CategoriesRoot>
和 的 Products.xml
<ProductsRoot>
<Products>
<ProductID>1</ProductID>
<ProductName></ProductName>
<CategoryID>1</CategoryID>
<UnitQuantity></UnitQuantity>
<UnitPrice></UnitPrice>
</Products>
<Products>
<ProductID>2</ProductID>
<ProductName></ProductName>
<CategoryID>2</CategoryID>
<UnitQuantity></UnitQuantity>
<Price></Price>
</Products>
</ProductsRoot>
如何使用XSL合并具有不同根的两个XML文件以获取输出
Merged.xml
<CategoriesRoot>
<Categories>
<CategoryID>1</CategoryID>
<CategoryName></CategoryName>
<Description></Description>
<Products>
<ProductID>1</ProductID>
<ProductName></ProductName>
<UnitQuantity></UnitQuantity>
<Price></Price>
</Products>
</Categories>
<Categories>
<CategoryID>2</CategoryID>
<CategoryName></CategoryName>
<Description></Description>
<Products>
<ProductID>2</ProductID>
<ProductName></ProductName>
<UnitQuantity></UnitQuantity>
<Price></Price>
</Products>
</Categories>
</CategoriesRoot>
我只遇到有关合并两个相关XML文件的问题,这些文件具有相同的根标记。任何帮助将不胜感激〜谢谢!