473,545 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSXML4 and selectSingleNod e

The following is a code snippet of a classic ASP webapplication:

Set l_oNode = p_oXML.selectSi ngleNode(l_sXPa th)
If (Not IsNull(l_oNode) ) Then
l_sValue = l_oNode.text
End If

According to http://www.devguru.com/Technologies/...ngleNode..html the selectSingleNod e 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
Feb 13 '06 #1
1 3607


Marja Ribbers-de Vroed wrote:
The following is a code snippet of a classic ASP webapplication:

Set l_oNode = p_oXML.selectSi ngleNode(l_sXPa th)
If (Not IsNull(l_oNode) ) Then


Compare the result of selectSingleNod e to the value Nothing e.g.
If Not l_oNode Is Nothing Then

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1462
by: milesd | last post by:
Hi, Rather new to MSXML4. I am parsing an XML data-stream over HTTP, and would like to know why I cannot parse XML nodes with multiple parameters. The XML and Code are below, BUT I would like to know how to parse individual XML nodes when tags are specified as "<FIELD NAME="collection">myVal........". The code below gives me "FIELD" as...
1
1690
by: tweety | last post by:
I had a problem with IE 6.0.2800. The responseText property of the XMLHTTP object was giving an error.There was a bug in msxml dll. so i upgraded to msxml4 and changed the code to the following: try { var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0"); }catch(e)
1
1672
by: T | last post by:
Is there a way to use the Visual Studio .NET IDE to validate a schema using the MSXML4 parser? Similarly, is there a way to get the .NET framework utilities, such as the xsd.exe and wsdl.exe utilities to validate and parse using the MSXML4 parser?
1
3839
by: jd | last post by:
I have an xsl file to generate xml in to an html file. The size of the xsl is 300kb and size of the xml is 47 kb (the size of xml is variable). I am using VB.net to convert the xml file into an html file. The vb.net module peforms following task: load the xml file in XMLDocument object ( I can't use XpathDocument object) load the xsl...
7
3803
by: Sashi | last post by:
Two questions: (1) I can pull the text of an XML element as a string just fine using code as such: strSomeString = myXmlDoc.SelectSingleNode("/Element1/Element2/Element3", myXmlNSMgr).InnerText;
2
1547
by: VernonR | last post by:
I'm having problems getting the .NET 1.1 XSL transform to cross reference using ID / IDREF correctly. I have collapsed to a simple set of files to show the problem more clearly... The output line using MSXML4.0 is correct <Output>First List Item = Hello</Output> The output using MSXML3.0 or the DOTNET XSL transform is <Output> = </Output>
3
3628
by: Eugen Gulinsky | last post by:
Hello guys, I am having problems trying to migrate our MSXML4-compatible stylesheets containing large msxsl:script blocks to a formate understandable by System.Xml:Xsl.XslTransform. I keep getting JS1135 errors saying that some variable was not declared. This scripts worked perfectly with MSXML4. Is there a guide for migraiton from MSXML to...
0
1784
by: compumate99 | last post by:
I am trying to parse the xml document using selectsinglenode method. I am doing this using Visual Foxpro >>> loResultXml = CreateObject("Microsoft.XMLDOM") With loResultXml .Async = .F. .Load(pcXmlFile) oPackage = .documentElement.SelectSingleNode("//Package")
0
1768
by: =?Utf-8?B?RHVja3dvbg==?= | last post by:
Hello everyone, I need to get the version number of a couple of DLLs (comctl32.dll and msxml4.dll). I don't have the full path because I don't want to assume they will be in the system32 folder. I have a function which first does... //get the current process p = Process.GetCurrentProcess(); //get all the dlls this class is using
0
7434
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7946
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.