选择具有属性的所有子项

时间:2014-11-16 11:10:20

标签: xml xpath xls

如何让所有在xpath或xsl中拥有任何(非特定)属性的孩子?

e.g:

<person id= "11">
        <name>A name</name>
        <language lang="en">Hello</language >
        <country region="Africa">Egypt</country>
        <date-of-birth>2002</date-of-birth>
</person>

我想回来:

<language lang="en">Hello</language >
<country region="Africa">Egypt</country>

1 个答案:

答案 0 :(得分:1)

如果您使用/person/*[@*],则选择具有至少一个属性的person元素的子元素。