Newbie Question #3

Hi

I am doing a very simple test of using web services, I added a Web Reference 
to a site that provides the latest exchange rates.

I got a string that contains XML Document that contains the required info

I would think that there is a standard method to parse the content of the 
XML document and make sense of the info provided. The only way that I can 
think of is to create an object based on the XML file (or the XSD) and then 
assign the value in a process that's is similar to deserialization

What is generally the approach to parse the data?

Thank you
Samuel 


0
11/12/2007 2:28:45 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
677 Views

Similar Articles

[PageSpeed] 16

Hi

For XML you have a few different options each one pros and cons in terms on 
memory and speed.

If you know the schema use the XSD.exe tool to generate a type based on the 
schema and use deserialisation. 

For speed use the XmlReader class.  You could also use XPathNavigator which 
is a bit more capable.

Finally you could load the XML into a DOM (XmlDocument) and select nodes 
using XPath queries.  It's probably the most resource intensive, but the most 
capable.

In your scenario where you're just reading small amounts of data I'd 
consider an XmlReader unless you wanted to pass the data around, in which 
case a bit of type generation and serialisation is much easier to work with 
when you're coding.

HTH

Glenn

"Samuel" wrote:

> Hi
> 
> I am doing a very simple test of using web services, I added a Web Reference 
> to a site that provides the latest exchange rates.
> 
> I got a string that contains XML Document that contains the required info
> 
> I would think that there is a standard method to parse the content of the 
> XML document and make sense of the info provided. The only way that I can 
> think of is to create an object based on the XML file (or the XSD) and then 
> assign the value in a process that's is similar to deserialization
> 
> What is generally the approach to parse the data?
> 
> Thank you
> Samuel 
> 
> 
> 
0
GlennAB (2)
11/13/2007 11:26:00 AM
That is a great help

Thank you,
Samuel


"GlennAB" <GlennAB@discussions.microsoft.com> wrote in message 
news:B3B5F573-F82F-463C-9509-B2BB3447BAE2@microsoft.com...
> Hi
>
> For XML you have a few different options each one pros and cons in terms 
> on
> memory and speed.
>
> If you know the schema use the XSD.exe tool to generate a type based on 
> the
> schema and use deserialisation.
>
> For speed use the XmlReader class.  You could also use XPathNavigator 
> which
> is a bit more capable.
>
> Finally you could load the XML into a DOM (XmlDocument) and select nodes
> using XPath queries.  It's probably the most resource intensive, but the 
> most
> capable.
>
> In your scenario where you're just reading small amounts of data I'd
> consider an XmlReader unless you wanted to pass the data around, in which
> case a bit of type generation and serialisation is much easier to work 
> with
> when you're coding.
>
> HTH
>
> Glenn
>
> "Samuel" wrote:
>
>> Hi
>>
>> I am doing a very simple test of using web services, I added a Web 
>> Reference
>> to a site that provides the latest exchange rates.
>>
>> I got a string that contains XML Document that contains the required info
>>
>> I would think that there is a standard method to parse the content of the
>> XML document and make sense of the info provided. The only way that I can
>> think of is to create an object based on the XML file (or the XSD) and 
>> then
>> assign the value in a process that's is similar to deserialization
>>
>> What is generally the approach to parse the data?
>>
>> Thank you
>> Samuel
>>
>>
>> 


0
11/13/2007 10:39:04 PM
Reply:

Similar Artilces:

Please help with Excel VB question
Hi, I'm trying to set a Name range in Excel through VB, by setting the name property when a specific cell in a worksheet is changed. The code is as follows: fred1 = CStr("=PL!$A$4:$E$" Worksheets("Control").Range("maxnumpass").Value) ActiveWorkbook.Names.Add Name:="numpasslist", RefersTo:=fred1 My problem is that the change is only active for the worksheet where I change the cell. Is it possible to ensure that this change takes effect across all worksheets in the workbook? Any and all help appreciated either in a reply to this post or on jgal...

Multithreading Question
Hi, I am writing a multithreaded server application. I have written a class to handle thread(CThread , say) activities like creating, suspending, resuming threads etc. I have derived a class from CThread (CMainThread, say) and a class (CClientThread, say) to handle client connection which is also derived from CThread. In CMainThread class i am creating a thread and waiting for incomming connections. As soon as a connection came i am creating an object for CClientThread and call the function to create a thread and so on. code flow: 1. Start the main listening thread. 2. wait for a con...

MS CRM Certification question
Hi all, I have a question regarding the CRM certification? What, if any, certifications are there available with MS CRM? Is there anything like CRM Professional? Have I earned any certification if I passed the Applications Professional exam? T.I.A -- Kuba Skalbania [MCAD] ...

update trigger question
If I have something like this in an update trigger: if update(FirstName) or update(LastName) begin update n set FullName = i.FirstName + ' ' + i.LastName from Names n inner join inserted i on n.NameID = i.NameID end I only want FullName to update if either FirstName or LastName are updated. Here's my question. A batch update updates 50 rows in the table. Of the 50, only 20 have changes made to the FirstName or LastName columns. It's my understanding that the "if update()" ONLY allows 20 rows that fit the if update criteria to be updated in the...

#VALUE! #3
I want A1 to report an error that is in A6 but my formula doesn't work. A6 reads: #VALUE! The formula A1 is =IF(AN6=#VALUE!,"You messed up","") Help. Try =IF(ISERROR(AN6),"You messed up","") -- Regards, Peo Sjoblom Excel 95 - Excel 2007 Northwest Excel Solutions www.nwexcelsolutions.com "Pencil" <pencil@unlisted.com> wrote in message news:Xns981091707C316pencilunlistedcom@208.49.80.60... >I want A1 to report an error that is in A6 but my formula doesn't work. > A6 reads: #VALUE! > The formula A1 is =IF(AN6=...

Newbie, accnts. payable & accnts.receivable sample DB
Hi guys, I�m running access 2003, windows xp pro SP2 I've been commission in my work to do a small application to track and report the accounts payable and accounts receivable movements, I'm not an accounting savvy person :(, does anyone know of a link or sample access database that can help me with the basic structure of the tables and reports?, any help would be greatly appreciated. Thanks ...

Really simple questions re CSliderCtrl
Using SetSelection() I can get a CSliderCtrl to display a highlighted selection ... but so what? What use is it other than to look pretty? Which of the following is possible, and how do I do them? (1) Prevent the user from moving the thumb outside the highlighted range. (This seems to be what the documentation suggests that SetSelection does, but in fact it doesn't, the thumb can be moved outside the selection.) (2) Have the user change the selection. (The documentation seems to suggest this is possible, but I can find no combination of keystrokes or mouse actions that will do it.) -- ...

text wrapping #3
How can I get text to flow through a picture? Right-click the text box, click format text box, layout tab, click "through." -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Carol" <Carol@discussions.microsoft.com> wrote in message news:F7EE1E11-4856-42EB-B472-514D1B44016D@microsoft.com... > How can I get text to flow through a picture? While waiting for decisions from his 6 university choices, Ed sees a message from Mary Sauer <gsauer@mycolumbus.rr.com>. On it is written: > Right-click the text ...

multithreading question
I drive my game's physics engine using a simple loop running on its own thread. It invokes Thread.Sleep(1) when processing takes little or no time (under 4ms) to allow real time to catch up. For heavier loads the loop uses bigger timeslices, up to 20ms, with no sleeps. Since this is a multithreaded application, I decided to break out CHESS to test the object (render) buffer for problems. But CHESS hates Thread.Sleep() - it fails any test that hits one, calls it a livelock. I ended up switching out the original realtime loop with a high resolution multimedia timer, but I ...

Categories #3
does anyone know how to search by categories on outlook 2003. for instance you press company, it will search by it but when uour press categories it doesent. how can i kae it search by categories? where are you "pressing category"? you can enter the category name in the find dialog, advanced find or set up a search folder... you can also group by category. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: ht...

Email Setup Questions
Howdy and Happy New Year! I just bought a new computer and I'm trying to set up Outlook. Other than logging onto work email using the internet from a hotel o at home, I've never used Outlook away from work. I have several different email accounts: Hotmail, AOL, and work emai (which uses Outlook). Is it possible to utilize Outlook to retrieve my emails from th separate accounts? Can I setup each of the folders for the differen email accounts all on the left side? After I set it up, how does Outlook know which account I'm using when send email? Hotmail? Work? I need h...

Visio Newbie
Hello all, this is my first time using Visio for drawing a floor plan and I have a quick question. Yesterday, (Using a tape measure) I mapped out the floor plan of an office my company might be moving into. I wrote everything down in Inches. Is there a way once I get a room shape kinda close to teh measurements, that I can manually type in teh length for each wall? if not in inches, at least in feet. For example, I have one wall that is 154 inches ( 12.83 ft) Then the next wall is 242 incehs( 20.1 ft) The opposite wall of the first measurement is 288 inches, third wall 100 inches, then 13...

General design question
hi! i'd like to design a class - let's call it CDrawObject - that is able to contain some data and draw itself. furthermore i'd like to have a class CDrawMultiObject that is derived from CDrawObject and can contain objects of type CDrawObject. i imagine to have the following situation: CDrawMultiObject -> base object (i.e. an object manager ) CDrawObject -> first element CDrawObject -> secound element CDrawMultiObject -> third element CDrawObject -> first element CDrawObject...

Exchange newbie problem
Hi all; A user on our domain was deleted when he should not have been. His mail box was not deleted. When his account was recreated, we tried to reconnect the old mailbox. But when selecting a user in the "Select a new user for this mailbox" dialog a message comes back saying that the user cannot be found. We tried several different users a none can be found even though they can get there mail just fine. We need to get the messages from this mailbox. Any ideas would be great -- Craig in the High Desert. craig@craignet.com But it's a dry heat. you should be able to reconnec...

C++ / Access Newbie
Hi Folks... I have a small commercial package written in C++ (targeted to Windows platforms) that uses its own proprietary database. We are just starting to investigate the option of replacing our database with a commercial package, such as Access or MySQL. Can anyone recommend informative reading that provides details on programming C++ with either of these two databases? At this stage we have no (any I mean ZERO) experience such programming. Any information would be helpful: recommendations for Access over MySQL (or vice versa), sources of such comparisons, licensing considerations, OD...

Microsoft Outlook problem #3
I have a problem with Microsoft outlook. I've reinstalled office and Outlook Express but nothing works. All the other office programs are fine but Outlook always comes up with a message: "Cannot start Microsoft Outlook. Outlook requires Microsoft outlook Express 4.01 or greater. You can install Outlook Express by running IE5Setup.exe from the IE5 folder located on your CD or through the Windows Updated website." I tried running IE5Setup.exe. That comes up with a message saying that the current version of Internet Explorer is more updated and the installation will end. I have ...

Printing question
We are having an issue with LPR printing using our software in conjucntion with a Windows 2008 server which is preventing us from being able to flash images to a printer from our application. We use Universe, SB+ and SBClient and would use the DOS shell from inside SBClient to use LPR print commands to send the images to the printer, this has worked fine on all other Windows servers but not 2008. What happens is when you drop to DOS you can browse to the %systemroot%\system32 folder and do a dir but you cannot see LPR. If you do the same from a normal command prompt the file ...

CFileDialog #3
How I can set my text for Sample text in CFileDialog? Tnx. Zizo wrote: > How I can set my text for Sample text in CFileDialog? > > Tnx. Sorry, CFontDialog.. :-) I haven't presonally tried using this but it might be a good start. http://codeguru.com/dialog/font_dialog.shtml Ali R. "Zizo" <zizo@zz.com> wrote in message news:bqi3em$58l$1@ls219.htnet.hr... > How I can set my text for Sample text in CFileDialog? > > Tnx. > > ...

Money vs Quicken #3
Does anyone know if Quicken tries to start the dialer everytime you run it like Money2005 does?? This is driving me nuts and I would consider changing if Quicken behaves better. Frank Quicken has this as a preference. I happen to have mine turned off. "Frank" <fjmet@amisp.net> wrote in message news:<ubF8I$suEHA.2196@TK2MSFTNGP14.phx.gbl>... > Does anyone know if Quicken tries to start the dialer everytime you run it > like Money2005 does?? This is driving me nuts and I would consider changing > if Quicken behaves better. > Frank Quicken 2005 doesn't ...

Data Labels On 3-D Bar Charts
I REALLY need to find a way to set my data labels at center or outside, the choices in a reguar bar chart. Is there any way to do that? And if you happen anyone happens to know if it is in any add-ins. I'm waiting to get the downloads UN-BLOCKED!! My work is a joke. Thanks ...

General Question
Is this the only way to get Outlook help without having to pay? There are lots of websites with information posted. http://www.slipstick.com for one. Of course there's always http://www.microsoft.com/outlook. And the online help files in Outlook. (Press F1) -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP http://home.hawaii.rr.com/schorr **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Amy" <anonymous@discussions.microsoft.com> wrote in message news:03c701c3a959$cafe41f0$a3012...

Open Relay #3
How do you shut off open relay? This is for exchange server 5.5. I found this article. http://www.unixwiz.net/techtips/exchange55-antirelay.html Sounds good but I'm not sure what ServicePack this exchange server is at? How can you tell what ServicePack exchange is at? I'm afraid this cleint has something older than SP 4. Thanks, BiG To determine the SP, you can check the properties>version of c:\exchsrvr\bin\mad.exe or admin.exe or just about any file in that directory. If they haven't upgraded to SP4 you can download it here (NOTE: You only need to download the releva...

2 Macro Questions
If I assign a macro to a forms button on the sheet if I copy the book and load it on my friends computer do the macros go with them. Can a macro button be assign to a cell so when clicked it will print (72,8) from that cell, and what formula would I need? -- Thanks in advance for your help....Bob Vance .. .. .. .. Hi Bob 1. Yes, the macro code is copied as well 2. You can add some code to the Doubleclick event of your button. I'm not so sure what you mean with 'print'? Insert a value in a specific cell. If yes, try the following code: Private Sub CommandButton1_Click() Me...

Renaming menuitem names in crm 3.0
hi everybody, I need to rename the menuitem names(for example:New,Save,Close) in menubar(for example File,Actions,Help) of an entity form.How to achieve this requirement? I am waiting for reply. Thanks prabhakar ...

newbie
joining the group Hey Newbie where are you from and what versiona re you using? Fliehigh "cthomas23@hotmail.com" wrote: > joining the group > ...