我想将下面的 xml 拆分为两个部分,每个部分包含两个流。包含的 4 个的产品,有没有什么方法可以使用 xpath 或 xpath-node 来实现这一点,我尝试了表达式:
/stream.PurchaseOrder/orderLine/products/stream.Product
它将产品分为 4 个部分,any1 可以帮助我表达或某种技术来实现要求吗?
<stream.PurchaseOrder>
<metaData>
<supplierId>1001</supplierId>
<supplier>Supplier1</supplier>
</metaData>
<orderLine>
<manufacturer>Manufacturer-1993628836</manufacturer>
<location>Location-1616142228</location>
<products>
<stream.Product>
<productId>852693979</productId>
<productName>ProductName-20</productName>
<price>100</price>
<model>Model413</model>
<quantity>50</quantity>
</stream.Product>
<stream.Product>
<productId>1111</productId>
<productName>ProductName11</productName>
<price>40</price>
<model>Model12</model>
<quantity>150</quantity>
</stream.Product>
<stream.Product>
<productId>85</productId>
<productName>ProductName3</productName>
<price>10</price>
<model>Model3</model>
<quantity>5</quantity>
</stream.Product>
<stream.Product>
<productId>11</productId>
<productName>ProductName4</productName>
<price>4</price>
<model>Model4</model>
<quantity>15</quantity>
</stream.Product>
</products>
</orderLine>
</stream.PurchaseOrder>