|
From: Marja Ribbers-de Vroed on 13 Feb 2006 07:36 The following is a code snippet of a classic ASP webapplication: Set l_oNode = p_oXML.selectSingleNode(l_sXPath) If (Not IsNull(l_oNode)) Then l_sValue = l_oNode.text End If According to http://www.devguru.com/Technologies/xmldom/quickref/node_selectSingleNode..html the selectSingleNode method should return Null when no node was found for the XPath expression, but it doesn't. At least not in a way that satisfies the "Not IsNull()" test. The program always tries to execute l_sValue = l_oNode.text which obviously results in errors when the node was not found. What am I missing? -- Marja
From: Martin Honnen on 13 Feb 2006 08:02 Marja Ribbers-de Vroed wrote: > The following is a code snippet of a classic ASP webapplication: > > Set l_oNode = p_oXML.selectSingleNode(l_sXPath) > If (Not IsNull(l_oNode)) Then Compare the result of selectSingleNode to the value Nothing e.g. If Not l_oNode Is Nothing Then -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/
|
Pages: 1 Prev: Text Wrap Next: Error Type: (0x80020009) Exception occurred. |