拥有一个这样的XML文档:
<?xml version="1.0" encoding="UTF-8"?> <records type="array"> <record> <name>svn</name> <record-type>A</record-type> <ttl type="integer">86400</ttl> <zone-id type="integer">69075</zone-id> <aux type="integer">0</aux> <id type="integer">xxx</id> <active>Y</active> <data>xxx.xxx.xxx.xxx</data> </record> <record> <name>domain.tld.</name> <record-type>NS</record-type> <ttl type="integer">86400</ttl> <zone-id type="integer">xxx</zone-id> <aux type="integer">0</aux> <id type="integer">xxx</id> <active>Y</active> <data>domain.tld.</data> </record> <record> <name>blog</name> <record-type>A</record-type> <ttl type="integer">86400</ttl> <zone-id type="integer">xxx</zone-id> <aux type="integer">0</aux> <id type="integer">xxx</id> <active>Y</active> <data>xxx.xxx.xxx.xxx</data> </record> </records>
如何匹配具有值为“A”的所有具有sibling / records / record / record-type的/ records / record / name?
找到了:
原文链接:https://www.f2er.com/xml/294029.html/records/record/name[../record-type/text() = "A"]