xml - XPATH to select all nodes which are not empty -


how select nodes have value , not empty? example, have following xml:

    <bbb>         <aaa/>         <bbb/>         <ccc>23</ccc>         <ddd/>         <eee>health</eee>         <fff/>     </bbb> 

here want select nodes children of bbb , have value i.e. nodes ccc , eee.

select nodes children of bbb , have value

if want include nodes contain whitespace, try:

/bbb/*[string()] 

if want ignore nodes contain whitespace (<x> </x>), try:

/bbb/*[normalize-space()] 

Comments