473,396 Members | 1,797 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,396 software developers and data experts.

XML from VB 6 to VB.net Help please

hi
I had the following code (fragment) in a VB6 app, what should the XML
bits look like in VB.Net?

Thanks

Public Sub XML_list(ByVal xml As String)

Dim xmldom As MSXML2.DOMDocument

xmldom = New MSXML2.DOMDocument

Dim node As MSXML2.IXMLDOMNode

Dim i As Integer

xmldom.async = False

xmldom.loadXML(xml)

i = 1

message_count = xmldom.getElementsByTagName("Seg").length

TairSegs = message_count

If message_count < 1 Then message_count = 1

ReDim messageTXT_count(message_count)

If Not xmldom.getElementsByTagName("Seg") Is Nothing Then

For Each node In xmldom.getElementsByTagName("Seg")

For xmlnodecount = 0 To node.childNodes.length - 1

node_name = node.childNodes.Item(xmlnodecount).nodeName
Nov 21 '05 #1
2 10479
Adrian:

See if this helps:

Imports System.Xml

Class TestClass

Public Sub XML_list(ByVal xml As String)
Dim xmldom As New Xml.XmlDocument
xmldom.LoadXml(xml)

Dim i As Integer = 1
Dim message_count As Integer =
xmldom.GetElementsByTagName("Seg").Count
Dim TairSegs As Integer = message_count

If message_count < 1 Then message_count = 1

Dim messageTXT_count(message_count) As String

If Not xmldom.GetElementsByTagName("Seg") Is Nothing Then

For Each node As Xml.XmlNode In
xmldom.GetElementsByTagName("Seg")
For xmlnodecount As Integer = 0 To node.ChildNodes.Count - 1
Dim node_name As String =
node.ChildNodes.Item(xmlnodecount).Name
Next
Next
End If
End Sub

End Class
Shariq Khan
sh****@shariqkhan.com
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:cs**********@titan.btinternet.com...
hi
I had the following code (fragment) in a VB6 app, what should the XML
bits look like in VB.Net?

Thanks

Public Sub XML_list(ByVal xml As String)

Dim xmldom As MSXML2.DOMDocument

xmldom = New MSXML2.DOMDocument

Dim node As MSXML2.IXMLDOMNode

Dim i As Integer

xmldom.async = False

xmldom.loadXML(xml)

i = 1

message_count = xmldom.getElementsByTagName("Seg").length

TairSegs = message_count

If message_count < 1 Then message_count = 1

ReDim messageTXT_count(message_count)

If Not xmldom.getElementsByTagName("Seg") Is Nothing Then

For Each node In xmldom.getElementsByTagName("Seg")

For xmlnodecount = 0 To node.childNodes.length - 1

node_name = node.childNodes.Item(xmlnodecount).nodeName

Nov 21 '05 #2
Excellent!

Many many thanks

"Shariq Khan" <sh****@shariqkhan.com> wrote in message
news:ep**************@TK2MSFTNGP09.phx.gbl...
Adrian:

See if this helps:

Imports System.Xml

Class TestClass

Public Sub XML_list(ByVal xml As String)
Dim xmldom As New Xml.XmlDocument
xmldom.LoadXml(xml)

Dim i As Integer = 1
Dim message_count As Integer =
xmldom.GetElementsByTagName("Seg").Count
Dim TairSegs As Integer = message_count

If message_count < 1 Then message_count = 1

Dim messageTXT_count(message_count) As String

If Not xmldom.GetElementsByTagName("Seg") Is Nothing Then

For Each node As Xml.XmlNode In
xmldom.GetElementsByTagName("Seg")
For xmlnodecount As Integer = 0 To node.ChildNodes.Count -
1
Dim node_name As String =
node.ChildNodes.Item(xmlnodecount).Name
Next
Next
End If
End Sub

End Class
Shariq Khan
sh****@shariqkhan.com
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:cs**********@titan.btinternet.com...
hi
I had the following code (fragment) in a VB6 app, what should the XML
bits look like in VB.Net?

Thanks

Public Sub XML_list(ByVal xml As String)

Dim xmldom As MSXML2.DOMDocument

xmldom = New MSXML2.DOMDocument

Dim node As MSXML2.IXMLDOMNode

Dim i As Integer

xmldom.async = False

xmldom.loadXML(xml)

i = 1

message_count = xmldom.getElementsByTagName("Seg").length

TairSegs = message_count

If message_count < 1 Then message_count = 1

ReDim messageTXT_count(message_count)

If Not xmldom.getElementsByTagName("Seg") Is Nothing Then

For Each node In xmldom.getElementsByTagName("Seg")

For xmlnodecount = 0 To node.childNodes.length - 1

node_name = node.childNodes.Item(xmlnodecount).nodeName


Nov 21 '05 #3

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

Similar topics

1
by: Numberwhun | last post by:
Hello everyone! I am trying to learn java and have run into kind of a snag. Here is the code that I have so far: ------ <begin_code> ---------- import javax.swing.*; import...
1
by: HolaGoogle | last post by:
Hi all, Please help me with the following..it's realy urgent and i tried everything i could and i can't get it work properly!! Thanks in advance. Here's what i'm trying to accomplish: in my...
0
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
2
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
4
by: fatboySudsy | last post by:
Hi, I have constructed a client program that has given me some error codes that i just cannot see. I was wondering if a different set of eyes with much more experience than me could help me out. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...

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.