473,666 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check for value of node

ok, I changed "If node.Text = "Success" " to "If Not loginDom.InnerT ext Is
Nothing ". Now, I don't get the NullReference error but the SessionID I see
on screen is concatanated one. It looks like:XXXXXX=YYY YY==, 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.InnerT ext

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 ParseLoginRespo nse(ByRef loginDom As XmlDocument) As Boolean
' See if the login was successful. If so, get the SessionID.
' Otherwise, log the error.
Try
ParseLoginRespo nse = False
'Feb13
Dim filterDoc As New XmlDocument

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

nsmgr.AddNamesp ace("ns", "urn:schema s -tms:LoginRespon se")

Dim node As XmlDocument

'Feb16
'node = loginDom.Select SingleNode("ns: LoginResponse/ns:Status")
node = loginDom.Select SingleNode("ns: LoginResponse/ns:Status",
nsmgr)
'Console.WriteL ine("Login successful: " & node.Value)

'testing feb17

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

'new Feb 14
'If node Is Nothing Then

'for testing
'Console.WriteL ine("Login successful: " & node.Value)
Console.WriteLi ne("Login successful: " & loginDom.InnerT ext)
node =
loginDom.Select SingleNode("ns: LoginResponse/ns:SessionID", nsmgr)
'Feb 20
Console.WriteLi ne("Login successful: " & node.Value)


'new for testing Feb16
'Dim resultImport As XmlNode
'resultImport = filterDoc.Impor tNode(node, True)
'filterDoc.Appe ndChild(resultI mport)
'Return True
'g_SessionID = loginDom.Value
ParseLoginRespo nse = True

Console.WriteLi ne("Login successful: " & loginDom.InnerX ml)
'Feb14

Else
'The login was not 100% successful
node =
loginDom.Select SingleNode("ns: LoginResponse/ns:SystemMessag e")
Console.WriteLi ne("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 1190

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

Similar topics

15
2627
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 lists to have duplicate strings when it is avoidable. I have a function createEdge that adds an edge to the graph. The arguments will be distinct since they are read from text files. But basically I want to use the dictionary as a string pool,...
8
3070
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 explain to me how I create a list and traverse it? In particular, how do I make use of the node.h method GetNext()? I don;t know what to do with it.
3
4049
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* xmlDoc = parser->getDocument(); xercesc::DOMNodeList* list;
2
3776
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" /> <record3 page_id="27" url="Regions.aspx"> <record4 page_id="55" url="RegionsEdit.aspx" /> </record3> </record> I need to compare whether a string value contains the url or not. If so,
1
9093
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 check first if the node exists before I try to replace it? Public Function ConvertDates(ByVal xmldoc As XmlDocument) As XmlDocument Dim nodelist As XmlNodeList Dim node As XmlNode Dim DateField As String
0
1490
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), I see it has child nodes, but nodes = Nothing.. Since, I need to copy the value of SessionID in my next function, how can I read the value of Node. If I do, LoginDom.InnerText, then I get"SuccessSessionID", if there is no way to get node value...
10
2194
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 #include<stdio.h> #include<alloc.h> struct node { int data; struct node *link;
9
18678
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
3239
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 grandchild nodes to true how do I automatically change that node's parent to check-true and so on up the tree.....and in reverse if the parent is changed to check-false how do I cascade that down to each of the child nodes and their child nodes.
0
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8362
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8878
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8560
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6200
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
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
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.