![]() | 1 imn1 2014-07-07 22:23:42 +08:00 ![]() 这个有点难,因为你用的是相对路径,差集太大了 .//div[@xyz]//div[not(@xyz)] 这个能找出不带xyz属性的div子节点,但似乎不合你的题意 |
![]() | 2 lins05 2014-07-07 22:32:31 +08:00 ![]() './/div[@xyz]//*[not(self::div[@xyz])]' |
![]() | 3 binux 2014-07-07 22:35:18 +08:00 ![]() .//div[@xyz and not(//div[@xyz])] |
4 node OP |
![]() | 6 imn1 2014-07-07 23:08:32 +08:00 查了一下,@lins05那个应该是正解,你先测试一下 |
![]() | 7 imn1 2014-07-07 23:13:30 +08:00 |
9 node OP |
![]() | 10 binux 2014-07-08 00:08:34 +08:00 哦,我理解错了 那应该是 .//div[@xyz and not(ancestor::div[@xyz])] |