我需要从给定的 XML 编写 XQuery,但找不到正确的方法。
这是xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Edited by XMLSpy -->
<onlinecomputer>
<item name="Processor" price="100.00"/>
<item name="USB driver" price="50.00"/>
<item name="Webcam" price="20.50"/>
<item name="Notebook" price="700.00"/>
<place>
<name>Prishtin</name>
<customer>
<name>Hana</name>
<street> Nen Tereza</street>
<order item="Processor" amount="1"/>
<order item="USB driver" amount="3"/>
<order item="Webcam" amount="3"/>
<order item="Notebook" amount="2"/>
</customer>
<customer>
<name>Ron</name>
<street> blbl</street>
<order item="Webcam" amount="1"/>
</customer>
</place>
<place>
<name>Tetove</name>
<customer>
<name>Edin</name>
<street> gggg</street>
<order item="Processor" amount="4"/>
<order item="Notebook" amount="1"/>
</customer>
<customer>
<name>Alex</name>
<street> bbbb</street>
<order item="Processor" amount="2"/>
</customer>
</place>
</onlinecomputer>
XQuery 应该编写一个表达式,该表达式将给出一组对(地点和项目),以便该项目已被运送到给定地点。
结果应该是这样的:
<answer place="nameOfPlace" item="nameOfItem" />