如何使用 xpath 将 xml 转换为另一种 xml 格式?xml 文件是动态的,它可以是任何级别,不同的标签。以下 xml 是一个示例:
<?xml version="1.0"?>
<student_info>
<total_stud>500</total_stud>
<student>
<id>1</id>
<name>abc</name>
<address>
<city>Pune</city>
<zip>411006</zip>
</address>
</student>
<student>
<id>1</id>
<name>bbc</name>
<address>
<city>Toronto</city>
<zip>82233</zip>
</address>
</student>
<student>
<id>2</id>
<name>wec</name>
<address>
<city>North York</city>
<zip>59522</zip>
</address>
</student>
</student_info>
致:所有学生“id=1”
<?xml version="1.0"?>
<student_info>
<student>
<name>abc</name>
<city>Pune</city>
<zip>411006</zip>
</student>
<student>
<name>bbc</name>
<city>Toronto</city>
<zip>82233</zip>
</student>
</student_info>