XML
<Galaxy> <name>Milky Way</name> <CelestialObject name="Earth" type="planet"/> <CelestialObject name="Sun" type="star"/> </Galaxy>
路径
/Galaxy/*[contains(lower-case(@name),'ear')]
要么
//*[contains(lower-case(@name),'ear')]
或者,使用双引号中的字符串:
//*[contains(lower-case(@name), "ear")]
输出
<CelestialObject name="Earth" type="planet" />