检查 XML NODE null [英] Checking for XML NODE null
本文介绍了检查 XML NODE null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在它到达这部分代码之前,有没有在这里检查一个空值?
Is there anyway to check for a null here before it reaches this part of the code?
tmpLabelData(0) = m_node.Item("CONTAINER_NAME").InnerText
有些 XML 具有,而有些则没有.我似乎找不到处理这些空值的好方法?
Some XML has it while others do not. I cant seem to find a nice way to handle a null on these?
大卫
推荐答案
If Not m_node.Item("CONTAINER_NAME") Is Nothing AndAlso _
Len(m_node.Item("CONTAINER_NAME").InnerText) > 0 Then
tmpLabelData(0) = m_node.Item("CONTAINER_NAME").InnerText
End If
这篇关于检查 XML NODE null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文