Skip Menu |

This queue is for tickets about the XML-Merge CPAN distribution.

Report information
The Basics
Id: 29897
Status: open
Priority: 0/
Queue: XML-Merge

People
Owner: Pip [...] CPAN.Org
Requestors: kdaquila [...] alum.wpi.edu
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in:
  • 1.0.4C2Nf0R
  • 1.0.4CAL5IS
  • 1.2.4CCJWiB
  • 1.2.565EgGd
Fixed in: (no value)



Subject: Feature proposal: merge on multiple unique ids
First, thank you for a highly useful module. It has worked simply and effectively for my particular problem. As my data sets evolved, though, I ran into one issue with XML::Merge. I have some data that looks like this: <root> <!-- set one --> <table name="a"> <group id1="1" id2="a"> <data1>...</data1> </group> </table> </root> <root> <!-- set two --> <table name="a"> <group id1="1" id2="b"> <data2>...</data2> </group> </table> </root> Here, I'm using multiple attributes on the group element as unique identifiers. I use "set_id_xpath_list()" to add id1 and id2 here (I also tried @*). When I merge these together with cres=main, I get: <root> <table name="a"> <group id1="1" id2="a"> <data1>...</data1> <data2>...</data2> </group> </table> </root> What I want to get is: <root> <table name="a"> <group id1="1" id2="a"> <data1>...</data1> </group> <group id1="1" id2="b"> <data2>...</data2> </group> </table> </root> I fear that I'm not familiar enough with the intentions of XML::Merge to know whether or not this is truly a bug, or intended operation. It seems to me, though, that support for multiple unique IDs per element can be considered an extra feature. In any case, I needed it and wanted to stick with XML::Merge, so I added support myself. I've attached my updated version of Merge.pm. It has an different Version (so I could tell it was my modded copy), and my fix. I tested this on a few data sets, though not exhaustively, and I believe it adds a feature without breaking others. I hope that you find this useful, and consider releasing a new version. Feel free to use this update directly, or modify it as you see fit. Thanks again for a great module, -Kevin D'Aquila
Subject: Merge.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #29897] Feature proposal: merge on multiple unique ids
Date: Wed, 10 Oct 2007 13:19:05 -0700
To: bug-XML-Merge [...] rt.cpan.org
From: "Pip Stuart" <pipstuart [...] gmail.com>
Thanks, Kevin, I'll try to include this new multi-id feature && your Make patch for RHEL the next time I get to preparing a package release for XML::Merge. I'm glad it has proven useful to you and thank you for contributing so kindly. =) -Pip@CPAN.Org On 10/10/07, Kevin J. D'Aquila via RT <bug-XML-Merge@rt.cpan.org> wrote: Show quoted text
> Wed Oct 10 11:02:08 2007: Request 29897 was acted upon. > Transaction: Ticket created by KDAQ > Queue: XML-Merge > Subject: Feature proposal: merge on multiple unique ids > Broken in: 1.0.4C2Nf0R, 1.0.4CAL5IS, 1.2.4CCJWiB, 1.2.565EgGd > Severity: Wishlist > Owner: Nobody > Requestors: kdaquila@alum.wpi.edu > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29897 > > > > First, thank you for a highly useful module. It has worked simply and > effectively for my particular problem. > > As my data sets evolved, though, I ran into one issue with XML::Merge. I > have some data that looks like this: > > <root> <!-- set one --> > <table name="a"> > <group id1="1" id2="a"> > <data1>...</data1> > </group> > </table> > </root> > > <root> <!-- set two --> > <table name="a"> > <group id1="1" id2="b"> > <data2>...</data2> > </group> > </table> > </root> > > Here, I'm using multiple attributes on the group element as unique > identifiers. I use "set_id_xpath_list()" to add id1 and id2 here (I also > tried @*). When I merge these together with cres=main, I get: > > <root> > <table name="a"> > <group id1="1" id2="a"> > <data1>...</data1> > <data2>...</data2> > </group> > </table> > </root> > > What I want to get is: > > <root> > <table name="a"> > <group id1="1" id2="a"> > <data1>...</data1> > </group> > <group id1="1" id2="b"> > <data2>...</data2> > </group> > </table> > </root> > > I fear that I'm not familiar enough with the intentions of XML::Merge to > know whether or not this is truly a bug, or intended operation. It seems > to me, though, that support for multiple unique IDs per element can be > considered an extra feature. > > In any case, I needed it and wanted to stick with XML::Merge, so I added > support myself. I've attached my updated version of Merge.pm. It has an > different Version (so I could tell it was my modded copy), and my fix. I > tested this on a few data sets, though not exhaustively, and I believe > it adds a feature without breaking others. > > I hope that you find this useful, and consider releasing a new version. > Feel free to use this update directly, or modify it as you see fit. > > Thanks again for a great module, > > -Kevin D'Aquila