suggested ways to manipulate XML files in .Net?

Hi everyone,

I'm going to manipulate some XML files in my next project-- crawl through
the tags, compare if file X has the same nodes as file Y, and if not, what
the differences are and who's missing what.  I'll also be comparing values
between nodes in the two files, for when both documents do have the same
named nodes.  What .Net classes should I be looking at to accomplish these
tasks?  Thanks a bunch.


0
babbaloo (5)
7/17/2006 10:26:19 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
473 Views

Similar Articles

[PageSpeed] 26


Steve Hershoff wrote:


> I'm going to manipulate some XML files in my next project-- crawl through
> the tags, compare if file X has the same nodes as file Y, and if not, what
> the differences are and who's missing what.  I'll also be comparing values
> between nodes in the two files, for when both documents do have the same
> named nodes.  What .Net classes should I be looking at to accomplish these
> tasks?  

Well there are lots of ways, Xml(Text)Reader is fast forward only pull 
parsing that does not consume much resources even if you read through 
big files.
XPathDocument reads the complete document into a tree structure 
optimized for XPath navigation which is read only.
Then there is XmlDocument which also reads the complete document into a 
tree structure but then allows manipulation of the tree and saving back.

If you want to compare XML files then the XML Diff and Patch tool
<http://msdn.microsoft.com/XML/XMLDownloads/default.aspx>
might be interesting for you.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1777)
7/18/2006 12:25:11 PM
Thanks, Martin.  I'll look into the XML Diff and Patch tools.

-Steve

>
> Well there are lots of ways, Xml(Text)Reader is fast forward only pull 
> parsing that does not consume much resources even if you read through big 
> files.
> XPathDocument reads the complete document into a tree structure optimized 
> for XPath navigation which is read only.
> Then there is XmlDocument which also reads the complete document into a 
> tree structure but then allows manipulation of the tree and saving back.
>
> If you want to compare XML files then the XML Diff and Patch tool
> <http://msdn.microsoft.com/XML/XMLDownloads/default.aspx>
> might be interesting for you.
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
babbaloo (5)
7/18/2006 2:43:14 PM
Reply:

Similar Artilces:

PUB File Viewer
Is there a PUB file viewer available? I have someone creating PUB files and sending them to me to review and I don't have Microsoft Publisher. Thanks in advance for any help... No, there not a Publisher Viewer. Have that person convert the file to a ,pdf and send you that for proofing. -- JoAnn Paules MVP Microsoft [Publisher] "Ray Mooney" <ray@mooney.net> wrote in message news:O7FjFXUjEHA.3612@TK2MSFTNGP12.phx.gbl... > Is there a PUB file viewer available? > > I have someone creating PUB files and sending them to me to review and I > don't have ...

XML Serialization problem
Hi folks! I have some XML Serialization problem. I searched Internet and found some good info but still can't resolve the problem. I have next situation: I have solution contains 2 projects: Proj1 and Proj2. Each project compiled to dll. In Proj1 contains Class1 And Proj2 contains Class2. Now, Class2 has reference to Class1. I want to XML serialize Class2. In order to do that I added attr: [XmlInclude(typeof(Class1))] before Class2 definition. It's compiled but when it's running it throws exception something like that: "File or assembly name Proj1, or one of its dependenc...

Access 2007 help file
I am using Access 2007. I cannot get any help information for Visual Basic. When in Visual Basic if I hit the help menu icon, I get an online help window to open, but every time I try to get information on "DAO reference" and follow the thread to the information I want, the answer screen is blank---i.e. no information at all; no words, no nothing! Did I install wrongly? Is this something new Turn off the option to search online help so that you are only using help from your computer. On the bottom right side of the online help screen, click the icon and change the ...

Embed Date/Time on existing Video File
I am creating a number of video files that have come from IP Cameras. I need to be able to embed the Date/Time into the file, so that when it plays, you see the current date/time appearing on the screen. I know the start time of the file. I was just wondering if anyone knew how to do this, either directly in VB, or if there is an ActiveX component around to do this. This has to be an automated process, rather than by hand. Thanks -Jerry Not sure if still current but I saw few years (?!) ago DirectShow Editing Services which was part of DirectX and is now at : http...

i seem to be having memory issues, will deplying a release build instead of a debug build help with memory usage of my .net process?
i seem to be having memory issues, will deplying a release build instead of a debug build help with memory usage of my .net process? ...

2000 File Export Issue
Running Outlook 2000 (9.0.0.2711) and trying to export a date range to Excel. I'm following the instructions, but all I get are the column headings -- no data. What am I doing wrong? ...

Deliver new email to pst file
If I change the location new email is delivered to by following the instructions below, will this work if outlook is closed? On the Tools menu, click E-mail Accounts. Click View or change existing e-mail accounts, and then click Next. In the Deliver new e-mail to the following location list, select where you want to the new messages delivered. Click Finish. Yes, the new mail will be delivered to the location you specify the next = time Outlook is opened and polls for mail. --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited ma...

Transfering XLM files between computers....
Hy!! Can someone tell me please how to do this type of work done by using C#...... Sorry, XML files,not XLM.... My mistake.... "Pilence" <ddinjar@gmail.com> wrote in message news:e4k342$pre$1@news2.carnet.hr... > Hy!! > > Can someone tell me please how to do this type of work done by using > C#...... > Pilence wrote: > Can someone tell me please how to do this type of work done by using > C#...... An Xml file is not different from other files in the file system or on the network so you can use tools like FTP to transfer files. Your requ...

How to add MFC Support to ATL Service in Visual C++.NET
This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C4A62F.EF5DEB80 Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable I=B4m trying to add MFC support to a ATL Service in VC7 but it doesn=B4t = seem to be the same way you do it in VC6, anyone knows howto? Regards ------=_NextPart_000_0008_01C4A62F.EF5DEB80 Content-Type: text/html; charset="windows-1256" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <ME...

how to transform xml according to c# vars
My menuing system uses xml/xslt to create the menus on my site. C# variable values dictate what menu items in the xml get translated by the xslt into the menu, and which are hidden. Say, if the user is logged in as non-admin, don't render the admin links. Currently, I have an extra attribute in the XML items for the menus called render which I later set to "yes" or "no" in C# by traversing the whole XML tree at runtime and checking whether it's OK to show (set to "yes"), or not (set to "no"). Then, once these values are set, I run it through the...

File Download Error
We recently had to do a database reattachment and subsequent new CRM 4.0 install for a customer who experienced a virus attack. Everything is stable and working but whenever we try to hit one of the Notes>>File attachment - we get a File Download Error and it won't find the link to the original document. We can't attach new files either. Anybody see this before? ...

Publisher 07 default files
Good morning. I have a question about setting defaults and I hope someone can help me. I have a user who would like to set her default file open to a certain location; has anyone set this up for Publisher 2007? Thank you in advance -- Diane Publisher 07 does not have this default as an option. You can create a Publisher folder, add to "My Places", when you save a Publisher document the folder will be one click away. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Diane" <Diane@discussions.microsoft.com> ...

Saving files with macros
I use to be able to set the protection properties to enable macros and everything with macros would work without halting. Now in 2007 I must save in ..xlsm format for this to happen. I am the only person on my computer and it's real pain to remember to file as a special format when I have created macros. Is there way to just allow macros period? -- Skip Using Office 2003 Pro 2007 Student version There is a setting in Office | Excel Options that saves all files as macro-enabled best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from emai...

.msi File Editing
I aplogize for posting this message here. I did not know where else to post it. If there is a more appropriate newsgroup, please point me to it. I have a .msi file created for installing Autodesk Architectural Desktop 2006 from an administrative image. This file was created when a prior server was in use. The new server has a different name and now the pathing contained within the file is no longer valid. The folder structure on the new server is the same, only the server name in the pathing needs to be changed. I would like to know how to edit the .msi file to change the serv...

dlls in VB.NET (VS 2008).
Hello. I have created class library (add -> new project -> class library. wrote some public function on class, such as Public Shared Function myfunction return integer. , and want to use some of my function. I do in code : imports myLib and I cannot access myClass (class is declared : Public Class myClass). What is wrong, and how can I use the classes on class library? Need sample, please. Thanks :) Solved. Sorry, it was wrong old dll on my folder. Thanks, anyway. ...

Dump way to fix : failed in launching MNY2004
Delete any mymoney???.mny generated from previous errors, Copy " sample.mny" as "mymoney.mny" or "whatever.mny" Open the new file, modified it ans save. Bcz I couldn't find any answer to fix the probelm, this is the dummy trial. ...

How do I insert several documents into one folder or file
I need to combine several word documents into a file or folder so that that folder can be sent as an attachment on e-mails On Wed, 31 Oct 2007 15:55:01 -0700, Elephant1 wrote: > I need to combine several word documents into a file or folder so that that > folder can be sent as an attachment on e-mails Word Documents? You have posted this message to the wrong newsgroup. The access in this groups name refers to Microsoft Access, a database program. Please repost to the correct newsgroup for whatever version of the Word program you are using. I would suggest you include your Windows a...

Unable to open .DOC file. FILE DOWNLOAD box appears
Got a new pc a few months back with Vista home premium. Transferred files from old pc, was able to open old documents ok. But now when I try to open any .doc file (including those recently created from email attachments) I get the "file download" box and when I click "open" the box just pops back up again. Can open files created with Works and other programs ok. (Sometimes when I am doing this I get the "Windows Explorer wants to close" message.) I have the disc to upgrade to Windows 7 which I assume will fix the problem. Any suggestions for a quick ...

Make a Macro Button Look the way I want it to, not from the list
I have just gotten 2007, in the past I have set up Macro buttons for printing to different trays, for Tray 1 I made the Macro button look like the number 1, Tray 2 Macro button looked like the number 2 and Stack Bypass Macro Button had SB on it. I have managed to set up the macro buttons but I can't figure out how to customize the bottons to look how I want them to look as in not from the range made available at the time of recording the macro. See http://www.gmayor.com/Toolbars_in_word_2007.htm or http://gregmaxey.mvps.org/Ribbon_Custom_Icons.htm or http://gregmaxey.mvps....

Opening Publisher file
When I send a Publisher file as an attachment, I always try to open it before sending to make sure it's ok. I get the message "This action is only valid for products that are currently installed." Just now someone tried to send me a Publisher file as an attachment and I got the same message. I'm using Publisher 2003, Outlook 2003 for e-mail -- Donna in Idaho Project Linus Boise/SW Idaho Coordinator Website: www.LinusIdaho.org http://community.webshots.com/user/donnakwilts Remove "invalid" to reply Do you get error number 1605? See if reading this artic...

tax filing
Hello Everyone, I bought MS Money 2004 this year so that I could file my federal tax return for free. Well, I have used hrblock.com now for 3 years (this will be my fourth) and I can not get their site to understand that I am entitled to a free federal filing. Has anyone else run into this problem? Any solutions out there? It is going to cost me an aditional $25 to file my taxes which I thought I didn't have to pay. I have emailed the hrblock support staff with no answer. Jeff BTW, I did use the "Returning Customer" link since I had used hrblock before. I certainl...

Multi sheet Excel file overwrites to single page PDF file
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have a four sheet Excel worksheet. <br> When I try to Save As PDF in the print menu, <br> it will create one single page PDF document (displaying only the last sheet). <br><br>Upon hitting Save A PDF, the print process window will pop up four times, each time processing 1 page - and in the end all I have a one page document... <br><br>I have checked the DPI in the page setup, all four sheets are set to Normal. What you're not taking into consideration is that an Excel wo...

Duplicate Element Names in Serialized XML
Hi All, Hoping someone can solve a problem for me. I am modifying the schema for a rather complex web service written in VB.NET. The services uses a large number of serialized classes to output the overall XML. The problem I am having is that I require 2 XML elements of the same name to be serialized from the 1 class. Due to the way the web service is written only 1 of these would be ever be called at a time. However, it seems that I get an exception if the same element name is used twice in one class.. any ideas? For example: 'start class here <XMLElement ("elementName&q...

Application Data redirection
I have a policy set to redirect users desktop and application data folders to a share. The test computer is windows XP running Office 2003. The odd thing is the folders are different on the servers vs what's on the local desktop. The server and desktop also have different files in the \Application Data\Microsoft\Outlook folder, which stores the users archive.pst file.\ The server has the following 2 files in the redirected folder Default Outlook Profile.xml Default Outlook Profile.srs The desktop has these files archive.pst extended.pst Is this behavior by default? Is there a way...

microsoft excell file converter for quatro pro 7
I am wondering how to convert quatro pro 6 and 7 files to excell format. I have Office xp professional specifically version excell 2002. If any one can give me assistance on this I would be appreciated I've never had to do it but excel does support quatro pro. i'm not sure about your versions. click file>open. at the bottom ,click the down arrow of the type of file box. scroll to and select quatro pro/dos this will light up all quatro pro file. open and save as excel. I would try one first then look it over to make sure that all went well. >-----Original Message----- &...