473,800 Members | 2,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1969
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.ToDeci mal(a) +
Convert.ToDecim al(b));
*
*
* private bool ColumnCompare .. and this line // bool returnValue =
(Convert.ToStri ng(a) == Convert.ToStrin g(b)); return returnValue;
*
*
* and 1 enhancement in the InsertGroupByIn to 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.FieldAlia s]=SourceRow[Field.FieldName];
}
*
* */
"Sanjib Biswas" <sa***********@ ieee.org> wrote in message
news:Ok******** ******@TK2MSFTN GP05.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="u rn:schemas-microsoft-com:xml-msdata">
<xs:element name="Data" msdata:IsDataSe t="true" msdata:UseCurre ntLocale="true" msdata:Prefix=" mdb">
<xs:complexType >
<xs:choice minOccurs="0" maxOccurs="unbo unded">
<xs:element name="Employee" >
<xs:complexType >
<xs:sequence>
<xs:element name="empName" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on 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_******** *************** *******@speakea sy.net...

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
2539
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 can envision unions of node sets, and unions of node text. But I know there's much more to the subject than that, if not more alternatives than greater technical detail. TIA,
2
1546
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 indexes) and populate a dataset using READXML. I then merge the contents of that DS (call it DS1) with a second DS (call it DS2) that I've created on the form that will be used to process the data transfer. I did that so my SQL would be generated (I...
3
1890
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, easiest, most efficient way of merging the 2 XML Documents? Can I use DataSet.Merge() facility in ADO.NET?? Any pre-requisites? Any other suggestions?
2
5563
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...................Field 2 Fred Smith........Red John Brown........Blue Fred Smith...................................Truck
1
4964
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 1. Query..I want to keep the fields seperatred. I do not want to sent on field with all accumulated languages from one person to Word. Each language should appear in the document in a separate cell Cross tables are not delivering the result I...
0
1156
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 information between the Web applications. Problem Statement: Suppose I have two different web applications WebApp1 and WebApp2, both of them have the
2
1190
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 mystyle1, mystyle2 As System.Web.UI.WebControls.Style
2
2429
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 everything. VB6, as repetitive as it was to retype menus, was at least consistent. It seems that VB.NET throws menu items wherever it feels like.
7
1771
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 they dont seem to merge. When I return a single table , this method works fine, but im returning 3 tables and the merge isnt happening. Is there anyway to find out how I can why a merge isnt occuring, as the merge doesnt return any errors,
2
1362
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 And a child form with: Edit View And when the child form is displayed, I want the menu to be:
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.