473,411 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to check for value of node

ok, I changed "If node.Text = "Success" " to "If Not loginDom.InnerText Is
Nothing ". Now, I don't get the NullReference error but the SessionID I see
on screen is concatanated one. It looks like:XXXXXX=YYYYY==, but did I do
wrong. Althouggh, I get the message, Satus as Success.Since, I have to use
this SessionID in another click event on the same page, how do I do this.I
tried,

g_SessionID= loginDom.Value
g_SessionID = loginDom.InnerText

I noticed, I don'et get any value for Node.

I appreciate your quick reply and thanku in advance. I am enclosing the
function below:
Private Function ParseLoginResponse(ByRef loginDom As XmlDocument) As Boolean
' See if the login was successful. If so, get the SessionID.
' Otherwise, log the error.
Try
ParseLoginResponse = False
'Feb13
Dim filterDoc As New XmlDocument

'Feb16
'Instantiate an XmlNamespaceManager object
Dim nsmgr As XmlNamespaceManager
nsmgr = New XmlNamespaceManager(filterDoc.NameTable)
' Setup the Dom to use XPath queries and also setup
' an Xml namespace prefix for use in the XPath queries.

nsmgr.AddNamespace("ns", "urn:schemas -tms:LoginResponse")

Dim node As XmlDocument

'Feb16
'node = loginDom.SelectSingleNode("ns:LoginResponse/ns:Status")
node = loginDom.SelectSingleNode("ns:LoginResponse/ns:Status",
nsmgr)
'Console.WriteLine("Login successful: " & node.Value)

'testing feb17

If Not loginDom.InnerText Is Nothing Then
' The login was 100% successful so get the SessionID.

'new Feb 14
'If node Is Nothing Then

'for testing
'Console.WriteLine("Login successful: " & node.Value)
Console.WriteLine("Login successful: " & loginDom.InnerText)
node =
loginDom.SelectSingleNode("ns:LoginResponse/ns:SessionID", nsmgr)
'Feb 20
Console.WriteLine("Login successful: " & node.Value)


'new for testing Feb16
'Dim resultImport As XmlNode
'resultImport = filterDoc.ImportNode(node, True)
'filterDoc.AppendChild(resultImport)
'Return True
'g_SessionID = loginDom.Value
ParseLoginResponse = True

Console.WriteLine("Login successful: " & loginDom.InnerXml)
'Feb14

Else
'The login was not 100% successful
node =
loginDom.SelectSingleNode("ns:LoginResponse/ns:SystemMessage")
Console.WriteLine("Login unsuccessful: " & node.InnerText)

End If

Catch ex As Exception
MsgBox("Can't parse login information" & vbCrLf & ex.Message)


loginDom = Nothing
'node = Nothing

End Try
End Function

Feb 20 '06 #1
0 1144

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

Similar topics

15
by: Andy C | last post by:
I am new to python, so please bear with me if I am making some conceptual error. Basically I want to create a graph with an adjacency list representation, but I don't want any of the adjacency...
8
by: J Peterman | last post by:
Im having a nightmare trying to understand these nodes and linked lists. I've posted my code for my node.h, node.cpp, linkedlist.h and linkedlist.cpp files in separates replies. Can someone...
3
by: keepyourstupidspam | last post by:
Hi, I am using xerces dom C++, I want to change an element value, here is the code I am using but the element in the file is not getting updated. ... ... ... xercesc_2_4::DOMDocument*...
2
by: Bob | last post by:
I have sitemap like XML, of which every element has an attribute "url", e.g. <record menu_id="240" name="Countries and States" url="Countries.aspx"> <record2 page_id="54" url="CountriesEdit.aspx"...
1
by: Philip Wagenaar | last post by:
I have an XML file that has a date element. I want to change this date to unix notation. This works, but if the XML does not have the element I cannot assign the DateField the value. How can I...
0
by: XML newbie: Urgent pls help! | last post by:
HI, I am working on VB.Net.My program connects to the remote host, once the login values are verified, it sends the SessionID. My problem is Although in "Logindom" variable( in the Auto window),...
10
by: raghu | last post by:
I have written code for single linked list...I get an error as Expression syntax in the line marked with ////////. Please correct me where am I going wrong. I compiled this in TURBO Compiler ...
9
by: Moses | last post by:
Hi All, How to check weather a node has sibling? Is there any function like " hasChildNodes() " Thanks in Advance Moses
2
by: =?Utf-8?B?bWFib25k?= | last post by:
I'm using a treeview control. One parent node, several child nodes, several grandchild nodes. Each of the nodes has a checkbox. My question, when the user changes the check value of one of the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.