Skip to main content
 首页 » 编程设计

xml之如何选择没有文本子元素的元素

2025年12月25日27emanlee

在下面的文档中,我试图使那些元素没有文本子级。
但一切努力都无济于事。

<a> 
      <b> 
         <c> this is nice place </c> 
      </b> 
 
      <d>  
         <e> where this place is </e> 
         <f> this place is very close to us</f> 
      </d> 
 
      <g>  
        <h/> 
      </g> 
 
     <i/> 
</a> 

请您参考如下方法:

这个怎么样:

//*[not(node())] 


Test query here