473,320 Members | 1,695 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,320 software developers and data experts.

XML merging

Hi All,

I am looking for XML merging for the following scenarios. I want to load both the input files and show in the tree viewer and highlight the differences. Now its up to the user to select the correct node. Any non conflicting differences should be automatically merge onto the merge document. Any suggestion/caveats on how to do this in VB.Net?

Regards
Sanjib

doc1.xml |doc2.xml
======== |========
<data> |<data>
<product> | <product>
<title>MS Access</title> | <title>MS Access Suite</title>
<price>350.00</price> | <price>350.00</price>
</product> | </product>
<product> | <product>
<title>MS Outlook</title> | <title>MS Outlook</title>
<price>300.00</price> | <price>250.00</price>
</product> | </product>
<product> | <product>
<title>MS Office</title> | <title>MS Office</title>
<price>450.00</price> | <price>450.00</price>
</product> | </product>
</data> | <product>
| <title>MS Visual ..Net</title>
| <price>310.00</price>
| </product>
|</data>

merge.xml
=========
<data>
<product>
<title>select the title name based on the decision</title>
<price>350.00</price>
</product>
<product>
<title>MS Outlook</title>
<price>select the price based on the decision</price>
</product>
<product>
<title>MS Office</title>
<price>450.00</price>
</product>
<product>
<title>MS Visual .Net</title>
<price>310.00</price>
</product>
</data>
Jun 26 '06 #1
3 1947
This may help:
as in, to find which items are duplicates:

http://support.microsoft.com/default...b;en-us;326145

Here are my notes about my implmentation of the KB

/*
* See KB http://support.microsoft.com/default...b;en-us;326145
* There were 2 bugs in the code as retrieved from the KB
*
* private object Add ... and this line // return (Convert.ToDecimal(a) +
Convert.ToDecimal(b));
*
*
* private bool ColumnCompare .. and this line // bool returnValue =
(Convert.ToString(a) == Convert.ToString(b)); return returnValue;
*
*
* and 1 enhancement in the InsertGroupByInto method
*
* case "last":
if (GroupBy.Length > 0)
{
//they specified a non aggr column .. but since there was no
GroupBy, it won't reflect accurate data, thus only set it when there is a
valid GroupBY
DestRow[Field.FieldAlias]=SourceRow[Field.FieldName];
}
*
* */
"Sanjib Biswas" <sa***********@ieee.org> wrote in message
news:Ok**************@TK2MSFTNGP05.phx.gbl...
Hi All,

I am looking for XML merging for the following scenarios. I want to load
both the input files and show in the tree viewer and highlight the
differences. Now its up to the user to select the correct node. Any non
conflicting differences should be automatically merge onto the merge
document. Any suggestion/caveats on how to do this in VB.Net?

Regards
Sanjib

doc1.xml |doc2.xml
======== |========
<data> |<data>
<product> | <product>
<title>MS Access</title> | <title>MS Access Suite</title>
<price>350.00</price> | <price>350.00</price>
</product> | </product>
<product> | <product>
<title>MS Outlook</title> | <title>MS Outlook</title>
<price>300.00</price> | <price>250.00</price>
</product> | </product>
<product> | <product>
<title>MS Office</title> | <title>MS Office</title>
<price>450.00</price> | <price>450.00</price>
</product> | </product>
</data> | <product>
| <title>MS Visual .Net</title>
| <price>310.00</price>
| </product>
|</data>

merge.xml
=========
<data>
<product>
<title>select the title name based on the decision</title>
<price>350.00</price>
</product>
<product>
<title>MS Outlook</title>
<price>select the price based on the decision</price>
</product>
<product>
<title>MS Office</title>
<price>450.00</price>
</product>
<product>
<title>MS Visual .Net</title>
<price>310.00</price>
</product>
</data>
Jun 26 '06 #2

I've built most of those structures for a database project of mine that
outputs into a color coded tree control (I used c#).

There are one or two articles on MSDN about loading an XML file into a
tree control using recursion.

There's probably a couple of ways to do it:

1. Merge the XML and then load.
2. Load doc1, then load the elements of doc2.xml

Either way, you would end up checking at the node level for a match to
product.

You can do some cool stuff with right clicks on tree nodes (another
article). I use them for opening up data driven menus.

You could do something like having the alterative price (where there are
two) be selectable with a right click on a green colored node. Then
the tree would refresh and the old price would be the alternative.

Sanjib Biswas wrote:
Hi All,

I am looking for XML merging for the following scenarios. I want to
load both the input files and show in the tree viewer and highlight the
differences. Now its up to the user to select the correct node. Any non
conflicting differences should be automatically merge onto the merge
document. Any suggestion/caveats on how to do this in VB.Net?

Regards
Sanjib

doc1.xml |doc2.xml
======== |========
<data> |<data>
<product> | <product>
<title>MS Access</title> | <title>MS Access Suite</title>
<price>350.00</price> | <price>350.00</price>
</product> | </product>
<product> | <product>
<title>MS Outlook</title> | <title>MS Outlook</title>
<price>300.00</price> | <price>250.00</price>
</product> | </product>
<product> | <product>
<title>MS Office</title> | <title>MS Office</title>
<price>450.00</price> | <price>450.00</price>
</product> | </product>
</data> | <product>
| <title>MS Visual .Net</title>
| <price>310.00</price>
| </product>
|</data>

merge.xml
=========
<data>
<product>
<title>select the title name based on the decision</title>
<price>350.00</price>
</product>
<product>
<title>MS Outlook</title>
<price>select the price based on the decision</price>
</product>
<product>
<title>MS Office</title>
<price>450.00</price>
</product>
<product>
<title>MS Visual .Net</title>
<price>310.00</price>
</product>
</data>

Jun 26 '06 #3
Hi John,

Thanks for the suggestions. I was trying to load the XML file in the TreeView. But I am getting an exception "Object reference no set" when parsing a node (red font) in the below XML file.

<?xml version="1.0" encoding="UTF-8"?>
<Data>
<xs:schema id="Data" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Data" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="mdb">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Employee">
<xs:complexType>
<xs:sequence>
<xs:element name="empName" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
.......
.......

But with the same code, I am able to load the XML file into TreeView.

"John Bailo" <ja*****@texeme.com> wrote in message news:J_******************************@speakeasy.ne t...

I've built most of those structures for a database project of mine that
outputs into a color coded tree control (I used c#).

There are one or two articles on MSDN about loading an XML file into a
tree control using recursion.

There's probably a couple of ways to do it:

1. Merge the XML and then load.
2. Load doc1, then load the elements of doc2.xml

Either way, you would end up checking at the node level for a match to
product.

You can do some cool stuff with right clicks on tree nodes (another
article). I use them for opening up data driven menus.

You could do something like having the alterative price (where there are
two) be selectable with a right click on a green colored node. Then
the tree would refresh and the old price would be the alternative.

Sanjib Biswas wrote:
Hi All,

I am looking for XML merging for the following scenarios. I want to
load both the input files and show in the tree viewer and highlight the
differences. Now its up to the user to select the correct node. Any non
conflicting differences should be automatically merge onto the merge
document. Any suggestion/caveats on how to do this in VB.Net?

Regards
Sanjib

doc1.xml |doc2.xml
======== |========
<data> |<data>
<product> | <product>
<title>MS Access</title> | <title>MS Access Suite</title>
<price>350.00</price> | <price>350.00</price>
</product> | </product>
<product> | <product>
<title>MS Outlook</title> | <title>MS Outlook</title>
<price>300.00</price> | <price>250.00</price>
</product> | </product>
<product> | <product>
<title>MS Office</title> | <title>MS Office</title>
<price>450.00</price> | <price>450.00</price>
</product> | </product>
</data> | <product>
| <title>MS Visual ..Net</title>
| <price>310.00</price>
| </product>
|</data>

merge.xml
=========
<data>
<product>
<title>select the title name based on the decision</title>
<price>350.00</price>
</product>
<product>
<title>MS Outlook</title>
<price>select the price based on the decision</price>
</product>
<product>
<title>MS Office</title>
<price>450.00</price>
</product>
<product>
<title>MS Visual .Net</title>
<price>310.00</price>
</product>
</data>

Jun 30 '06 #4

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

Similar topics

3
by: William Ahern | last post by:
I'm looking for resources on splitting and merging XML trees. Specifically, on methods to pare large XML documents into smaller documents which can be merged later. Off of the top of my head, I...
2
by: Klatuu | last post by:
Whew, I've struggled my way through figuring out how to use XML to transport data..now I can imagine what having a baby is like :) But, I'm stuck now. I generate the XML (single table, no...
3
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best,...
2
by: Emmett Power | last post by:
Hi, I have an Access table with a number of records which refer to the same person but with data in different fields. So for example the table would look like this: Name..............Field...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
0
by: Naresh Narwani | last post by:
Problem Summary: Merging two different web applications into one create a problem for User Controls. Reason for merging two different Web Application: To share non serializable object...
2
by: Ponnurangam | last post by:
Hi, I have created two styles from cssclass and merged first one with the second one. I then used the style for an Item. The styles are not merging. Here is the code that I used Dim...
2
by: Dave Taylor | last post by:
Is there a decent explanation of how menu merging with MDI forms work in VB.NET? I've read through the online help and it still seems that whenever I change menus around or whatever, it breaks...
7
by: Jon Vaughan | last post by:
I have 2 datasets , one returned as a dataset from a webservice and one created client side form the same stored procedure that is returned from the webservice. I then try and merge the data, but...
2
by: Tom Costanza | last post by:
For the life of me, I can't seem to merge main menu items from child to parent with MDI forms. I can merge sub-menus, but not main menu items. So I have a parent form with: File Windows Help...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.