vb.net newbie needs help with basic XML parsing?

vb.net newbie needs help with basic XML parsing?

Post by <ch.. » Sat, 21 Dec 2002 02:00:52



I have an app that is a little strange.
I am connected via ethernet & tcp/ip to a device.

I make a request via a "telnet" connection to it and it returns the
following information as a string.  (vbcrlf) means it has a carriage rtn &
line feed in the string.

"1(vbcrlf)27(vbcrlf)<FLOAT>216.000015</FLOAT>(vbcrlf)"

two questions

Is there an easy way to get just what is between the FLOAT tags?

How do I handle it if there is many <FLOAT> tags in the string?

thanks for any help.

 
 
 

vb.net newbie needs help with basic XML parsing?

Post by Joe Fese » Sat, 21 Dec 2002 02:53:56


if there are multiple float tags, they must be contained inside another tag
since only one tag can be TOP level in XML.

You should be able to load a valid xml document into a new XmlDocument()

if only one node exists (XmlDocument.DocumentElement.ChildNodes.Length = 0)
then you can just take the value of DocumentElement

If ChildNode Count is > 0 then you have more nodes.

You can then get the InnerText Property of each of the nodes by using a
foreach loop.

Hope this helps

Joe Feser


> I have an app that is a little strange.
> I am connected via ethernet & tcp/ip to a device.

> I make a request via a "telnet" connection to it and it returns the
> following information as a string.  (vbcrlf) means it has a carriage rtn &
> line feed in the string.

> "1(vbcrlf)27(vbcrlf)<FLOAT>216.000015</FLOAT>(vbcrlf)"

> two questions

> Is there an easy way to get just what is between the FLOAT tags?

> How do I handle it if there is many <FLOAT> tags in the string?

> thanks for any help.


 
 
 

1. newbie need help vb.net+xml

hello group,

i recently began to use vs.net but previously use vs.

I got some question to ask experts to get some advice:

1. Which language is better C# or VB.net? I will learn both but which
one should be first?

2.I coudn't find enough ebook on the internet to download. Where can i
find them? do you have any address?

3.I want to use xml in my application.I don't want to use relational
databases. I want to use xml files as a db table.But I got some problem
to get data in xml.
For example:

<-----data.xml----->
<item1>
    <item2>
         <item3>DATA
         </item3>
    <item2>
</item1>
<------------------->

i want to get the data is stored in <item3> node.How can i do this in
vb.net?

2. rename local machine

3. Please help newbie to parse xml

4. Special St. Patrick's Day Font Now Online

5. Date problems with XML in ASP.NET / VB.NET- newbie question

6. Is there an 800x600x16 trident driver around

7. First time with XML in VB.NET and I need some help...

8. Email Evidence Eliminator and tell them you are sick of spam !

9. Vb.net XML Digital Signature Problem, need help...

10. VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET USA/Canada

11. Need help with XML parsing, XPath, nodes and other strange stuff *s*

12. need help parsing xml

13. Help needed - Can't upgrade VS.NET Trial to VB.NET Standard on win2k