Fast XML Document Parsing?

I currently parse an xml document using the XmlTestReader class. The
xml doc contains several records, each of which contains about 10
elements. I then convert each element in a record into its equivalent
C# data type (e.g. for float values, I use float.Parse(elementVal) )

I then perform calculations using each of these converted values
before overwriting the values when the next xml record is parsed.

Is this the best technique?

shearne (4)
7/6/2004 9:30:58 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 23

Depends how many of the values you convert and how many times you update
each instance in memory.  If the document stays loaded for a long time and
you update all the values many times, then it would be better to convert the
XML to an object graph so that you do the conversion once at serialization
time.  If you only update a few values then stream the document back out
then the XmlTextReader/XmlTextWriter is the most efficient.

"Sean Hearne" <> wrote in message
> I currently parse an xml document using the XmlTestReader class. The
> xml doc contains several records, each of which contains about 10
> elements. I then convert each element in a record into its equivalent
> C# data type (e.g. for float values, I use float.Parse(elementVal) )
> I then perform calculations using each of these converted values
> before overwriting the values when the next xml record is parsed.
> Is this the best technique?
> <rec>
>    <val1>
>    <val2>
>    <val3>
> </rec>
> <rec>
>    <val1>
>    <val2>
>    <val3>
> </rec>

clovett1 (13)
7/7/2004 12:17:49 AM

Similar Artilces:

Documenting Customizations
I have been looking around for an easy way to pull our customizations information out of 3.0 in some organized fashion so we can see all the changes we've made without sorting through a huge xml document or 100 different entity change documents. So far I have come up empty. Has anyone seen a tool or method for this? If I find anything I will post back. This might be a start, though it won't show you any customizations to onload or onchange events, nor will it show you any isv.config customizations: http://yourcrmserver/sdk/list.aspx provides a list of all of the attributes an...

The installation document for HRP Suite needs editing
The installation document HRPSuiteInstallation.PDF omits any reference to uninstalling PTO Manager. It also needs some comments about the upgrade process and a reminder to back up databases before starting table updates. Finally, a customer installing one product in the suite should not need to load all those .cnk files. It causes unnecessary launch file bloat. This document can and should be much more user friendly. Grade - D+ ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click ...

Fast Food Users
I would like to know if there are any RMS users out there that utilize the RMS software in a Fast-Food application. I need a refference for the RMS software using that type of application. 909-923-5268 ...

XML schema validation #3
Hi, I have a XML file which I validate against a schema using the following: doc.Schemas.Add("", xsdSchema); doc.Validate(new System.Xml.Schema.ValidationEventHandler(ValidationErrorEvent)); This works fine, and I get the correct error when changing element names and structure. But when the XML to validate contains a different namespace than the one trying to validate I don't get an error, I can see why. So my question is how do I define the schema or my code to fail validation when a wrong NS is contained in the XML. Samples: <root><elements>value</elements>...

split massive xml file
I have an xml file (sample below) that is massive. hundreds of megs maybe thousands. I need to split it up into multiple files so each file gets a copy of the header element and sub elements and 1 detail element. There will be 1 file created for each detail element. Any tips how to do this? Can I get away with not loading the whole file into memory at one time? sample: <header> </header> <details> <detail /> <detail /> <details /> "Jeremy" <> wrote in message news:%23oCR4hcsHHA.1208@TK2MSFTNGP03.phx.gbl....

Comparing Excel Documents
How do may I compare two worksheets the way you can compare documents in word, so that the differences are highlighted? Thanks HTH Brand Myrna Larson and Bill Manville have developed a compare that's very nice. look for compare.xla But the bad news is that this does a cell-by-cell comparison. A1 compares to A1, x99 to x99, etc. If you insert/delete a row or column, then this won't work very well. ======= Other alternatives that may work depending on what kind of differences you're looking for: Save each worksheet as a .csv file a...

XML syntax coloring
Hi. I would like to ask If somebody don't have any small sample to coloring XML syntax, e.g. in RichTextBox. It can be in VB.NET or C#. I watched on SharpDevelop, but I could not understand that code, which is coloring text. Thanks. ...

Reading XML
I am reading the field names of Leads into a dataset - and only the first 13 or so show up. I import them to a string - then to a dataset. Do you think the string is the limiting factor? I am basically trying to mimic the Import Wizard for Leads and add a duplicate check function. If anyone knows where the code is for that wizard I would appreciate it as well!! THANKS! How are you getting the field names? Using SQL to get them would be much easier and considerably faster (the SDK is horrible slow compared to SQL calls, just don't use SQL to make changes, read only). I'm assumi...

how to avoid IE open a deffirent application when open a new document in IE
hi all I have accountered a trouble. I opened an active document in IE by typing it's name in IE location bar, IE displayed a dialog box ask if I want to ope in place or save the document, I choosed open in place , it worked well, but when I typed another document's name in IE's location bar, als it asked me to open or save agin, I choosed open, but all seemed different, it doesn't work, I inspected the processes , I found another active document application have started by IE, so I think maybe this is the key. anyone has any idea? thanks a lot. ...

XSLT: dataset XML -> HTML
Hi Guys, I need a little help, I have XLM extracted from ADO.NET Dataset: <?xml version="1.0" ?> <NewDataSet> <xs:schema id="NewDataSet" ...> <xs:element name="NewDataSet" msdata:IsDataSet="true"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="my_table"> <xs:complexType> <xs:sequence> <xs:element name="fld1" msdata:Caption="Field 1" msprop:DataType...

How do I create an 11 X 17 document in Word?
I am trying to create an 11X17" document in Word and I get a message that my margins don't fit. When I go to print preview about 1/3 of the document isn't showing. The same thing happens in Publisher. What am I doing wrong? I'll bet your printer can't handle an 11 x 17 sheet of paper. You need drivers for one that does. -- JoAnn Paules MVP Microsoft [Publisher] "A vexed teacher" <A vexed> wrote in message >I am trying to create an 11X17" document ...

ANN: XMLMax Virtual XML Editor Beta
Xponent LLC is pleased to announce round two beta testing of its XMLMax Virtual XML Editor. Beta testers who work with xml documents, preferably with files several megabytes to several gigabytes in size, are needed at this time. XMLMax is a validating xml editor written in C# that is W3C compliant, supports xpath 1.0 and is namespace aware. It provides xpath query and editing of any xml file, including ones too large to load into a DOM or other in-memory application. Xponent website: ****** Key Features: ****** * Incremental parsing and loading allow editi...

performance of system.xml vs msxml4.0
I have an xsl file to generate xml in to an html file. The size of the xsl is 300kb and size of the xml is 47 kb (the size of xml is variable). I am using to convert the xml file into an html file. The module peforms following task: load the xml file in XMLDocument object ( I can't use XpathDocument object) load the xsl file in XSLTransform object perform the transformation. When I was using VB6 with Msxml 4.0 parser, I was getting good performance results. The transformation was completed in an average time of 40-50 milli second. When the same trasformation was perf...

Voucher payables document date 2018
A voucher (check) was posted with the Document Date of 12/17/2018. The invoice itself was dated 12/17/2008. We are trying to VOID this transaction but I get: "The void date cannot be before the document date" (meaning today of 1/16/2009 is before 12/17/2008) The Payables Transaction Posting Journal/Payables Management shows INV Voucher # with the doc date as 12/17/2008 but Check reconciliation cannot be completed because this check is out of the period. Please advise best method of fixing this error. Thank you Pam, Either go into the table and change the document date or c...

print list of all styles in document
I want to view/print a single list showing ALL of the styles being used in a Publisher document, so I can see the font names, sizes and other characteristics in order to help keep a consistent look and feel in the document. I can look at only one at a time and would have to either print the screen image or write it down to get the full list; one way wastes a lot of paper/toner, the other seems terribly inefficient. Is there an easy way? ...

How to save macro changes in Read-Only documents?
I have over 100 documents that need the same sentence changed in each one. The documents have the read-only recommended box checked. I ran a batch to remove the password to modify but it didn't remove the read-only recommend. So when I run a macro to change the text I get an error. When I ran Debug it highlighted "myDoc.Close Savechanges:=wdSaveChanges" but I don't know what to do with that. (I only copy the macros from this great site!) I am looking for a way to remove the read-only recommended from multiple documents in a file. Please help. Many th...

Questions on Document/View architecture
Hi, I've gone over several books that I bought off-shelf on MFC. But even now, I can't understand what the document is used for. The most confusing element is OnOpenDocument and serialize For onopendocument, the book indicates that you can initialize array elements and other stuff. However, what happens when I want to load stuff from disk amd initialize it on Onopendocument, I guess it is coming from the serialise method. But I did not find a place you can find the file's name.... Please help. Jack Jack wrote: > Hi, > I've gone over several books that I bought o...

How to generate MS Word documents (CRM3.0)
�ste es un mensaje de varias partes en formato MIME. ------=_NextPart_000_001E_01C8A624.D4495BB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi: =20 We need Dynamics CRM generates MS Word documents merging CRM data and = static Word templates. As far as we know, there isn't a simple way to = have this functionality in place, so there are some third parties = selling such type of add-on. =20 Do you know any good product (and cheap) being capable to perform a mail = merge and generating Word documents? Note: Documents we need ...

Double click to open a pdf document
I have a form with a list of documents in the harddrive but not inside MS Access. How do open the documents by double clicking on the selected document which are mostly pdf documents? I have the acrobat reader. Application.FollowHyperlink Me.NameOfControlContainingFullPathToPDFFile -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "JP" <> wrote in message >I have a form with a list of documents in the harddrive but not inside MS > Access....

Fetch XML to Query Expression
I'm trying to convert the following Fetch XML statement to a Query Expression to post using the RetrieveMultiple webservice: <fetch mapping="logical"> <entity name="role"> <attribute name="name" /> <link-entity name="systemuserroles" from="roleid" to="roleid"> <filter> <condition attribute="systemuserid" operator="eq-userid" /> </filter> </link-entity> </entity> </fetch> I haven't been able to find an documenta...

Word 2004 crashes when editing document
Hello, I am using Word 2004 for OS X. Today, Word 2004 began crashing whenever I tried to edit a specific document. I downloaded the Office update (11.1, I think), and it still crashed. I removed Office, removed all preferences, re-installed Office and the update, and Word still crashes. Thank you in advance for your help. The error log follows: Microsoft Error Reporting log version: 1.0 Error Signature: Exception: EXC_BAD_ACCESS Date/Time: 2005-01-16 17:18:55 -0500 Application Name: Microsoft Word Application Version: Module Name: Microsoft_Drawing_2001Z Module Version: 11....

How to parse an XML file
Hi. This should be a walk in the park for almost anyone... I'm a skilled win32 programmer, trying to learn 2.0 I've tried making a XML file parsing it to draw a GUI (web application) I have a small example: <?xml version="1.0" encoding="utf-8" ?> <Persons> <Person ID="ET40"> <FirstName>Bart-Jan</FirstName> <LastName>Brouwer</LastName> </Person> <Person ID="ET50"> <FirstName>Morten</FirstName> <LastName>Jacobsen</LastName> </Person> </Persons> I ...

Error 79 when printing SOME documents from Office
I am having a problem printing SOME documents from Office 2004 versions of Word, Entourage, and Excel. Here are the system details: Mac G5 1.6 MHz, 512 RAM, running Panther 10.3.4; Office 2004 Printer: HP Laserjet 5000, connected by ethernet using a 600N Jet Direct card. When printing some documents (particularly those created in older versions of Office and under System 9 on a G3) I get the error message 79.00FE PRINTER ERROR, which requires I restart the printer. These documents will NEVER print on this printer. This occasionally occurs in a few other applications, but mostly with Offi...

Four-colored Publisher Document converted to PDF & emailed.......
when opened by recipiant, i.e., lettering and subtitles in created in blue comes out as black. Is there any way to created a multi-colored Publisher document, convert doc to PDF, email, and yet have all colors retained in such a PDF file once emailed and opened? Great board for info! ReBell Sticks, MS Are you using Acrobat? What version Publisher? How to create a PDF file in Publisher Spot colors in EPS graphics distill incorrectly to Printer Definition File (PDF) as color separations in Publisher 2003

Datalist with an xml file
This is a multi-part message in MIME format. ------=_NextPart_000_000B_01C6359F.293BB990 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable How do I get all the name(s) listed in the datalist? <asp:DataList ID=3D"DataList1" runat=3D"server" = DataSourceID=3D"XmlDataSource1"> <ItemTemplate> <table> <tr> <td><%# XPath("Name")%></td> </tr> </table> </ItemTemplate> </asp:DataList> <asp:XmlDataSource ID=3D"XmlDataSource1&quo...