473,396 Members | 1,865 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.

Simple XML parser in vb.net?

I get a string returned from a C++ COM+ object that will look something
like this if the call is successful:

"OK: <guest_no>1234567890</guest_no>"

I do a
if mid(mystring, 5) = "OK: "

to test for success, and then I'd like to just parse out that guest_no
value. Is there a simple call to do this from a string? Everything I've
found in terms of examples and documentation seems a lot more complicated
than what I need to do. I'd love to have something like guest_no =
obj.parse(mystring, "guest_no"). Is there anything like that? Thanks!

Matt

--

Matt

"Gravity. It's not just a good idea, it's the law!"
Nov 18 '05 #1
1 1090
MattB wrote:
I get a string returned from a C++ COM+ object that will look something
like this if the call is successful:

"OK: <guest_no>1234567890</guest_no>"

I do a
if mid(mystring, 5) = "OK: "

to test for success, and then I'd like to just parse out that guest_no
value. Is there a simple call to do this from a string? Everything I've
found in terms of examples and documentation seems a lot more complicated
than what I need to do. I'd love to have something like guest_no =
obj.parse(mystring, "guest_no"). Is there anything like that? Thanks!

Matt


Use an XmlDocument object, there's a LoadXml method that takes a string,
and puts it in the document object. If it's not really compliant XML
(unlike your example), I might suggest using a regular
expression/pattern matching.

---
Craig Deelsnyder
Microsoft MVP - ASP.NET
Nov 18 '05 #2

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

Similar topics

3
by: Kenneth Downs | last post by:
Well, I'm coming to the end of a large and exhausting project, done in my new favorite language PHP, and its time for a diversion. I'm wondering if anyone has experience with writing simple...
8
by: Dan | last post by:
Using XML::Simple in perl is extreemly slow to parse big XML files (can be up to 250M, taking ~1h). How can I increase my performance / reduce my memory usage? Is SAX the way forward?
4
by: Greg B | last post by:
Well since getopt() doesn't seem to be compatible with Windows, and the free implementation of it for Windows that I found still had some annoying restrictions, I thought I'd whip up a simple...
4
by: =?Utf-8?B?SmFu?= | last post by:
In my application the user can configure automation-scripts by inserting different "actions" into a "procedure". These different procedure- and action-objects are all translated into C# code before...
7
by: bvdp | last post by:
Is there a simple/safe expression evaluator I can use in a python program. I just want to pass along a string in the form "1 + 44 / 3" or perhaps "1 + (-4.3*5)" and get a numeric result. I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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.