Comparing two XML files in C#

Hallo everybody,

I have the following problem. There are two XML files: first one
(FIRST.xml) includes all products definition, the second one
(SECOND.xml) is a product instance. What do I need is to compare these
two files.

Let's see an example:

FIRST.xml
<Product ID="">
    <Element ID=""/>
    <Element ID=""/>
     .....
    <Element ID=""/>
</Product>

SECOND.xml
<Root>
    <Products>
        <Product ID="">
            <Module Name=""/>
            <Module Name=""/>
            ...
            <Module Name=""/>
        </Product>
        ...
        <Product ID=""/>
    </Products>
    <Modules>
        <Module Name="">
            <Element ID=""/>
            <Element ID=""/>
            ...
            <Element ID=""/>
        </Module>
        ...
        <Module Name=""/>
    </Modules>
</Root>

What do I need to do is find appropriate Product from SECOND.xml. If I
have it then there is a need to find all Modules content (all ELements)
of this Product and finally to compare FIRST.xml with the processed
information. Could you provide some C# source code to solve it ?

It is the first step of little bit more complicated problem.

Thanks in advance for the help 
Chris

0
10/11/2006 11:24:36 AM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
538 Views

Similar Articles

[PageSpeed] 23

Reply:

Similar Artilces:

Signing XML with a X509 Certificate
I'm trying to sign a XML with a X509 Certificate (Like an email), and store it in a database. I want to include the certificate in the XML in order to display the certificate properties (like click in the red insignia in a signed email message) for this purpose I'm using Visual Basic .Net 2003 with WSE 2.0 preview edition I succefully signed the XML with a certificate installed in my repository the next step (for I am asking help) is to include certificate properties in XML for displaying purposes, and any way to call the certificate properties dialog with this info. This is th...

compare
Hello everyone, I have been reading this group for a while, however I am quite a rookie in using of excel. I would appreciate if someone could help with this issue. I quite often have to compare two sheets (from different workbooks-files, but with the same sheet name). Calculations are thus updated time by time and I need to check where were the main differences. Cells contain both values and formulas. I have found through this newsgroup nice add-ins of Myrna Larson and Bill Manville, and Rob Bruce. However I would need the macros to highlight only significant differences (let's say fro...

File in C drive is always trying to access Drive A
Hi, I have a file in my C drive where I keep all my Excel goodies. When I open that file, every time I recalculate the sheet, it always tries to access a file from my Drive A. If I have the calculation on automatic, it tries to access Drive A every time. I do not have any links with a reference to a Drive A. I tried the findlink.xla add-inn with all the links, but with no success in finding the problem I even deleted ALL the links, yet the file still tries to find the DriveA Any ideas, why it does this, and does anyone have a solution? Thanks Andr´┐Ż Do you have named ranges that mig...

How to make two codes "Worksheet_Change" work together in same sheet code page
Friends, Please, anybody knows how to make these two VB codes work together? When I put them together in the same "sheet code page" in VBA, th second one doesn't work. Why? *** Code 1 *** Private Sub Worksheet_Change(ByVal Target As Range) * * On Error GoTo QuitCode * * If Intersect(Target, Range("c1:c15")) Is Nothing Then * * * * Exit Sub * * ElseIf Target.Value <>*"" And Target.Offset(0, -1).Value = "" Then * * * * MsgBox "You haven't typed the name of the client yet." * * * * Target.Offset(0, -1).Activate End If QuitCode: ...

Do Macros cause corruption of big files
I frequently use Macros for formatting csv, dat or prn type of files. I am told that such frequent use of Macros may corrupt the files. Is it true? Since .csv and .prn (and .dat???) are plain old text files, they shouldn't be corruptible at all. If you're saving the file as .xls, then I've never noticed any correlation between macro use and corrupt files. But I'd say finding the reason a file gets corrupted is pretty difficult. Abhay wrote: > > I frequently use Macros for formatting csv, dat or prn type of files. I am > told that such frequent use of Macros may...

Publisher 2003 improperly references files in a web publication
When I publish to the web, all references are complete paths pointing to the local hard drive. I con't copy this to a web server. How do I change this behavior. This worked properly in Publisher 2000. In the future please make use of the correct forum for the subject matter, in this case that would be microsoft.public.publisher.webdesign - you will find tons of info in our forum to help you. You would find several threads on your topic in our forum to assist you. 2002/2003 do not include external files in the publish. This is also documented in the Microsoft Knowledge Base. http://...

MRU File List
Can someone point me to a MRU File List tutorial? -Tom R. "Thomas Rybka" wrote: > Can someone point me to a MRU File List tutorial? > > -Tom R. > I am certain there are better solutions; but the following code worked for me.... // When we create a new document the first time, we will // fill that documents first view with data read from the // first file in the users Most Recently Used (MRU) list of files. (or "Recent File List") // String defined per documentation (Word "File", ending with formating "%d") static cons...

Two Email Accounts not able to reply out of one of them
Hello All, I was wondering if someone here has ran into this problem. I currently have two email accounts setup in Exchange I can receive email in both of these accounts and view the email in Outlook 2003. In my default account if I receive an email I can reply back. But in my secondary mailbox if I receive an email I cannot reply back I get a error message which is listed below. On the secondary account I have added my username under permissions and gave it full access but I am still getting the below error. Anything will help thanks. Your message did not reach some or all of the inten...

Comparing
I have two columns of numbers column A could be up to 3500 rows. Column B may be more or less than 3500 rows. What I'm trying to do is see if any number in columns "B" appears anywhere in Column "A", and if so we can just highlight it in both columns. Actually I would want to be able to sort by highlighted. so maybe add someway to sort by matched or unmatched. I hope this makes sense. In column C put... =IF(ISNA(VLOOKUP($A1,$B:$B,1,FALSE)),"Not in B","In B") In column D put... =IF(ISNA(VLOOKUP($B1,$A:$A,1,FALSE)),"Not in ...

zoom error when opening file
When opening an Excel file it zooms the font only to 200% (very large). The menus are all regular size, and going into the view menu and changing the view to something different resizes the font to its correct size. I can then change the view to what is needed. Any suggestions? ...

I need to recover my .pub files after re-installing xp...
Hi there. I am wondering if anyone knows of an easy way to recover my .pub files from my hard drive? I had to re-install my operating system, and lost a few REALLY important files. Any leads on a fix / product that does this would be appreciated, and free options would be really helpful. Spunky1 wrote: > Hi there. I am wondering if anyone knows of an easy way > to recover my .pub files from my hard drive? I had to > re-install my operating system, and lost a few REALLY > important files. > > Any leads on a fix / product that does this would be > appreciated, and fr...

Two databases or one
Hi, What if you have two organizations and you plan to design a database to do the same task but within that task, the defined tables will vary because of unique qualities related to the individual organization. Would it be best to create separate databases for each organization or keep the two organizations together? Anyone know the guidelines related to this? Thanks for any feedback. Ask yourself this - How often will you need the combined data? -- Build a little, test a little. "AccessKay" wrote: > Hi, > > What if you have two o...

XML Validator Revisited ?
Hello Gurus, This is part of my XML File. <Group ID="100"> <Name>Dotnet XML</Name> <Member ID="BA1908">Guru Bhai</Member> </Group> When I validate this xml against a schema using XmlValidatingReader and when I get a error in the ID attribute of the Node Group, How can I get the Node or _FullName of that attribute. I cannot access _FullName which gives me the node name which is "Group", I get this error 'System.Xml.XmlValidatingReader._FullName' is inaccessible due to its protection level Is there a way I can get th...

how to create formula to divide two rows autoaatically
Is there any way to setup a sheet or create a formula so that it will divide the data in column A by Column B anytime the data is entered and put it into columnC ? What I am trying to do is create a spreadsheet for calculating fuel MPG. So I have columns as miles, gallons and the calculation as MPG. What I want to do is anytime a value is entered into miles and gallons, to calculate mpg and put it into that respective cell. Is there any way I can do this ? Thanks -- Tony Tony, in Column C, type the formula =sum(a1/b1). This should give you the result you are looking for. Hop...

2 workbooks
I have got 2 workbooks with a list of names. I need to find out if a name appears in both books. One of the workbooks came from a different source and the other one is a report I ran from our database. I need to find out whether the workbook from out of the company has got any of our own names on it. I am using Microsoft Excel 97 and am fairly new at this so please be gentle. One way I did think was to combine the two workbooks into one and find the duplicates but thought there may be another way. Thank you. Hi "queen on", Assume that In book1 the names are in column A, s...

Compare two files and update data from another file base on words in a cell separated by commas
I have two file with several colomns. I need to compare two Col B fileA Col B of FileB as shown in example. http://spreadsheets.google.com/ccc?key=0AgUVfFOnkiaKdFBiNDFLamcybXdhW... Each col have about 1000 rows. Each row contains thousands of words and phrases separated by Comma. As you can see from example, my data has soo many words and phrases separated by comma in each row of two colomn A and B. ============== i Need to merge data of corresponding row from COLA$FileB TO corresponding row of COLA$FileB Also merge data of corresponding row from COLB$FileB TO correspondin...

Cannot create file error. Cannot open or save tif files...please h
Error I an receiving when trying to open a tif file as follows: Cannot create file:Remittance_advice.tif.right-click the folder you want to create the file in, and then click properties on the shortcut menu to check your permissions for the folder I am using windows vista and office 2007 outlook I cannot open or save a tif file. I can open all other file attachments. I can forward to another pc in my office and they can open. they can rename the tif and resend to me and I can open. original name is remittance_advice.tif and renamed is remittance_advice1.tif. this just start...

Dell Quad core. Office 2007. very slow to open a file
When I click on an xlsx or docx file it takes a long, long time for it to come up. This was also true with Office 2003 so I bought a copy of Office 2007. On Tue, 1 Jan 2008 07:45:01 -0800, the Count <the Count@discussions.microsoft.com> wrote: >When I click on an xlsx or docx file it takes a long, long time for it to >come up. This was also true with Office 2003 so I bought a copy of Office >2007. Do you have a question, Your Excellency? If you have questions about .xlsx files it might be well to post them in an Excel newsgroup; there are Word groups for .docx file...

How do I convert an Excel file to a CSV file?
I am new to Excel and am trying to learn as I go. I am trying to convert my Excel Spreadsheet to an CSV file. Is there a simple way to do this? File>Save As>Save as Type In 2007 Button>Save As>Other Format>Save as Type You will find *.CSV in the list. Gord Dibben MS Excel MVP On Mon, 8 Mar 2010 14:21:02 -0800, beagleyt <beagleyt@discussions.microsoft.com> wrote: >I am new to Excel and am trying to learn as I go. I am trying to convert my >Excel Spreadsheet to an CSV file. Is there a simple way to do this? ...

differences between two tables
I'm trying to find the differences between two tables, A and B. There are some records in A that are not in B, there are some in B that are not in A, and there are some in both but with differences in the fields. I'm not getting everything. Does anyone have any ideas how I can tackle this? Thanks! Use a UNION ALL query. -- KARL DEWEY Build a little - Test a little "denise" wrote: > I'm trying to find the differences between two tables, A and B. There are > some records in A that are not in B, there are some in B that are not in A, > and there are s...

Can message be directed to file folder and recipient at the same t
Trying to send message to person x and at the same time have it filed in another folder other than the "Sent" folder. Is it possible to do this? Yes it is! Click on the Options button in that email and under Delivery Options there should be a checkmark to "Save Sent Message to" and you'll see that the default displayed is Sent Items. Click the Browse button and select your folder from the list. -- K. Orland Such as are your habitual thoughts, such also will be the character of your mind; for the soul is dyed by the thoughts - Marcus Aurelius "Jimp...&quo...

Excel file opens MS Excel Training Webpage When the Excel file ope
I have a file that I think was originally created using the on-line MS training. Now evertime I open the excel file the web page automatically opens. It's mostly just an annouance. I was able to copy the content into a new file and it stopped this behavior but I'd love to know how it happened and/or how to turn it off in the original file. Excel 2007 - mail merge file - opens thle link below everytime I open the excel file http://office.microsoft.com/training/training.aspx?ver=12&ver=12&app=excel.exe&AssetID=RH011206001033 Thanks John ...

two tables with same field names
I create an order status table for my division each week by running queries on corporate's systems. The field names are always the same, and there lies my problem. I need to measure the change in promise dates weekly to the order line level. For example, I need to pull last monday's promise date minus this monday's promise date to get the change in number of days. Post your table structure so a query can be assembled. -- KARL DEWEY Build a little - Test a little "deb" wrote: > I create an order status table for my division each week by running queries > o...

Why does Outlook open two windows?
When installed Outlook 2003 with a new profile about two hours ago, it would open one window each time I started Outlook. But now, after I've been doing a lot of work on the folder structure, particularly transferring dozens of folders by drag and drop within a single non-default PST file. I notice that the computer has been very noisy for a while, apparently furiously coping with the changes I've been making. Now when I start Outlook, it opens two windows; presumably that's an outcome of something I inadvertently did when transferring all the folders. I'd rather it ...

Referencing two (or more) cell values in formula
Hi, Can anyone tell me the correct syntax for referencing two cells as a criterion in a formula. For example if I want to sum cells in b1:b5 if cells a1:a5 are greater than the value in c2 I would write the following: =sumif(a1:a5,">"&c2,b1:b5) If I want to sum b1:b5 if cells in a1:a5 are greater than the value in c2 and less than c3 what should I write? =sumif(a1:a5,and(">"&c2,"<"&c3),b1:b5) this doesn't work and neither does this.... =sumif(a1:a5,and(>c2,<c3),b1:b5). Any help gratefully received. Thanks, Will willcull@...