我只想解析Margherita
与标签相关的值。可以解析标签相关的值吗?
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<item>
<id>1</id>
<name>Margherita</name>
<cost>155</cost>
<description>Single cheese topping</description>
</item>
<item>
<id>6</id>
<name>Margherita</name>
<cost>155</cost>
<description>Single cheese topping</description>
</item>
<item>
<id>8</id>
<name>Margherita</name>
<cost>1535</cost>
<description>Single cheese topping</description>
</item>
<item>
<id>2</id>
<name>Double Cheese Margherita</name>
<cost>22e5</cost>
<description>Loaded with Extra Cheese</description>
</item>
<item>
<id>3</id>
<name>Fresh Veggie</name>
<cost>110</cost>
<description>Oninon and Crisp capsicum</description>
</item>
<item>
<id>4</id>
<name>Peppy Paneer</name>
<cost>155</cost>
<description>Paneer, Crisp capsicum and Red pepper</description>
</item>
<item>
<id>5</id>
<name>Mexican Green Wave</name>
<cost>445</cost>
<description>Onion, Crip capsicum, Tomato with mexican herb</description>
</item>
</menu>
在上面的 XML 中,我只想显示与Margherita
标签相关的值。这可能吗?如果是这样,怎么做?