Using empty/solo XML tags in 'if' statements...?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Sometimes in my XML files I come across solo tags e.g. <Items />, and ideally Id like an if statement for all the ones I know crop up, so if theyre not empty and have content, it can start to read them; mostly because assuming theres always content
has lead to crashes when I loaded XML files with empty/solo tags. I tried selecting a node in the usual way, but there doesnt seem to be an .IsEmpty property or any such thing...
Also Id like to be able to tell if a node exists at all in the XML file, because sometimes nodes I want to read from arent there at all (leading to more crashes), so itd be good to put that code inside an if (node exists in file) {} statement as well...
Cheers :)



View the full article
 
Back
Top