Null value question
I've written this code for my XML reader:
Now sometimes - when it reads this - it's going to come across nodes such as:
<field />
Obviously in that situation - there is no InnerText and as such it will generate an error:
At least I presume that's what is causing the error since it works fine with nodes that contain innertext.
Anyhow, my question is - what can I do to continue to stop that error message but still have NodeText set as value of blank.
Thanks,
Chris
I've written this code for my XML reader:
PHP:
NodeText = XmlNode.ChildNodes.Item(XmlChildNodeCount).Innertext
Now sometimes - when it reads this - it's going to come across nodes such as:
<field />
Obviously in that situation - there is no InnerText and as such it will generate an error:
Object referance not set to an instance of an object.
At least I presume that's what is causing the error since it works fine with nodes that contain innertext.
Anyhow, my question is - what can I do to continue to stop that error message but still have NodeText set as value of blank.
Thanks,
Chris