DeltaXML Support Forums
| new topic post reply | XML Technologies -> Filters -> problem in deleting a element in the comparison |
problem in deleting a element in the comparison | ||
Posted:
03-July-2008 16:13 old xml <book> <chapter id="chapter_4"> <sect1 condition="trusteesandofficers" continued="true" id="chapter_4-sect1_1"> <table cols="2" datatype="2" primary="" render="0" rows="17" style="" tabletype="8"> <tbody> <row condition="TT1L"> <entry> Michael H. Koonce<sbr/> Secretary<sbr/> DOB: 4/20/1960<sbr/> Term of office since: 2000 </entry> <entry> Principal occupations: Senior Vice President and General Counsel, Evergreen Investment Services, Inc.; Secrtary, Senior Vice President and General Counsel, Evergreen InvestmentManagement Company, LLC and Evergreen Service Company, LLC; Senior Vice President and Assistant General Counsel, Wachovia Corporation <footnoteref alt="1" idref="577390002" label="3" order="1" size="1" type="button" value="577390002"/> <footnoteref alt="1" idref="577400002" label="4" order="1" size="1" type="button" value="577400002"/> <footnoteref alt="1" idref="577410002" label="5" order="1" size="1" type="button" value="577410002"/> </entry> </row> <row condition="TT1L"> <entry> James Angelos<sbr/> Chief Compliance Officer<sbr/> DOB: 9/2/1947<sbr/> Term of office since: 2004 </entry> <entry> Principal occupations: Chief Compliance Officer, Evergreen Funds and Senior Vice President of Evergreen Investments Co, Inc; Former Director of Compliance, Evergreen Investment Services,Inc <footnoteref alt="1" idref="577420002" label="6" order="1" size="1" type="button" value="577420002"/> <footnoteref alt="1" idref="57743" label="7" order="1" size="1" type="button" value="57743"/> <footnoteref alt="1" idref="57744" label="8" order="1" size="1" type="button" value="57744"/> </entry> </row> </tbody> </table> </sec> </chapter> </book> New xml <book> <chapter id="chapter_4"> <sect1 condition="trusteesandofficers" continued="true" id="chapter_4-sect1_1"> <table cols="2" datatype="2" primary="" render="0" rows="17" style="" tabletype="8"> <tbody> <row condition="TT1L"> <entry> James Angelos<sbr/> Chief Compliance Officer<sbr/> DOB: 9/2/1947<sbr/> Term of office since: 2004 </entry> <entry> Principal occupations: Chief Compliance Officer, Evergreen Funds and Senior Vice President of Evergreen Investments Co, Inc; Former Director of Compliance, Evergreen Investment Services,Inc <footnoteref alt="1" idref="577420002" label="6" order="1" size="1" type="button" value="577420002"/> <footnoteref alt="1" idref="57743" label="7" order="1" size="1" type="button" value="57743"/> <footnoteref alt="1" idref="57744" label="8" order="1" size="1" type="button" value="57744"/> </entry> </row> </tbody> </table> </sec> </chapter> </book> got Result <book xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:delta="WFmodify" > <chapter deltaxml:delta="WFmodify" id="chapter_4"> <sect1 deltaxml:delta="WFmodify" condition="trusteesandofficers" continued="true" id="chapter_4-sect1_1"> <table rows="16" deltaxml:delta="WFmodify" cols="2" datatype="2" primary="" render="0" style="" tabletype="8"> <tbody> <row deltaxml:delta="WFmodify" condition="TT1L"> <entry deltaxml:delta="WFmodify"> <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>Michael H. Koonce</deltaxml:PCDATAold> <deltaxml:PCDATAnew>James Angelos </deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> <sbr deltaxml:delta="unchanged"/> <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>Secretary </deltaxml:PCDATAold> <deltaxml:PCDATAnew>Chief Compliance Officer</deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> <sbr deltaxml:delta="unchanged"/> DOB: <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>4/20/1960</deltaxml:PCDATAold> <deltaxml:PCDATAnew>9/2/1947</deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> <sbr deltaxml:delta="unchanged"/> Term of office since: <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>2000 </deltaxml:PCDATAold> <deltaxml:PCDATAnew>2004 </deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> </entry> <entry deltaxml:delta="WFmodify"> Principal occupations: <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>Senior Vice President and General Counsel,</deltaxml:PCDATAold> <deltaxml:PCDATAnew>Chief Compliance Officer, </deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> Evergreen <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>Investment Services, Inc.; Secrtary,</deltaxml:PCDATAold> <deltaxml:PCDATAnew>Funds and </deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> Senior Vice President <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>and General Counsel,</deltaxml:PCDATAold> <deltaxml:PCDATAnew>of </deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> Evergreen <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>InvestmentManagement Company, LLC and </deltaxml:PCDATAold> <deltaxml:PCDATAnew>Investments Co, Inc; Former Director of Compliance,</deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> Evergreen <deltaxml:PCDATAmodify> <deltaxml:PCDATAold>Service Company, LLC; Senior Vice President and Assistant General Counsel, Wachovia Corporation</deltaxml:PCDATAold> <deltaxml:PCDATAnew>Investment Services,Inc </deltaxml:PCDATAnew> </deltaxml:PCDATAmodify> <footnoteref idref="577420002" value="577420002" deltaxml:delta="WFmodify" alt="1" label="3" order="1" size="1" type="button"/> <footnoteref idref="57743" value="57743" deltaxml:delta="WFmodify" alt="1" label="4" order="1" size="1" type="button"/> <footnoteref idref="57744" value="57744" deltaxml:delta="WFmodify" alt="1" label="5" order="1" size="1" type="button"/> </entry> </row> <row deltaxml:delta="delete" condition="TT1L"> <entry> James Angelos<sbr/> Chief Compliance Officer<sbr/> DOB: 9/2/1947<sbr/> Term of office since: 2004 </entry> <entry> Principal occupations: Chief Compliance Officer, Evergreen Funds and Senior Vice President of Evergreen Investments Co, Inc; Former Director of Compliance, Evergreen Investment Services,Inc<footnoteref alt="1" idref="577420002" label="6" order="1" size="1" type="button" value="577420002"/> <footnoteref alt="1" idref="57743" label="7" order="1" size="1" type="button" value="57743"/> <footnoteref alt="1" idref="57744" label="8" order="1" size="1" type="button" value="57744"/> </entry> </row> </tbody> </table> </sec> </chapter> </book> Expected Result <book xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:delta="WFmodify" > <chapter deltaxml:delta="WFmodify" id="chapter_4"> <sect1 deltaxml:delta="WFmodify" condition="trusteesandofficers" continued="true" id="chapter_4-sect1_1"> <table rows="16" deltaxml:delta="WFmodify" cols="2" datatype="2" primary="" render="0" style="" tabletype="8"> <tbody> <row deltaxml:delta="delete" condition="TT1L"> <entry> Michael H. Koonce<sbr/> Secretary<sbr/> DOB: 4/20/1960<sbr/> Term of office since: 2000 </entry> <entry> Principal occupations: Senior Vice President and General Counsel, Evergreen Investment Services, Inc.; Secrtary, Senior Vice President and General Counsel, Evergreen InvestmentManagement Company, LLC and Evergreen Service Company, LLC; Senior Vice President and Assistant General Counsel, Wachovia Corporation <footnoteref alt="1" idref="577390002" label="3" order="1" size="1" type="button" value="577390002"/> <footnoteref alt="1" idref="577400002" label="4" order="1" size="1" type="button" value="577400002"/> <footnoteref alt="1" idref="577410002" label="5" order="1" size="1" type="button" value="577410002"/> </entry> </row> <row condition="TT1L"> <entry> James Angelos<sbr/> Chief Compliance Officer<sbr/> DOB: 9/2/1947<sbr/> Term of office since: 2004 </entry> <entry> Principal occupations: Chief Compliance Officer, Evergreen Funds and Senior Vice President of Evergreen Investments Co, Inc; Former Director of Compliance, Evergreen Investment Services,Inc<footnoteref alt="1" idref="577420002" label="6" order="1" size="1" type="button" value="577420002"/> <footnoteref alt="1" idref="57743" label="7" order="1" size="1" type="button" value="57743"/> <footnoteref alt="1" idref="57744" label="8" order="1" size="1" type="button" value="57744"/> </entry> </row> </tbody> </table> </sec> </chapter> </book> Note: I am using PipelinedComparator to compare the files. If you see the difference between the expected result and the got result, the result that i got is collapsed blacklining. Here in the old xml I have a table with two rows with footnoteref element and in the new xml i have deleted the first row. I compared the two xmls. In the diff xml I have the result as the first row as modified and the second row as deleted. What can I do to resolve this problem. I am helpless. Could you help me how to do? | ||
RE: problem in deleting a element in the comparison | ||
Posted:
04-July-2008 12:51 Hi Arul, Firstly, from the example output you have included, it looks like you are using an older version of DeltaXML Core. We have recently released version 5.0 which, among other things, includes a new improved result format. You can download this at http://www.deltaxml.com/library/downloads.html and request a new evaluation key to use with this version. I have tried to reproduce the result that you are getting from this comparison and I am unable to. Firstly, I had to edit the XML documents you included above as they were not valid. The </sec> closing tags needed to be changed to </sect1> closing tags. Comparing these new valid inputs with various settings always gave me the result you were expecting, with the first row being deleted. Are you using any input filters on the documents before you compare them? You are using the PipelinedComparator to compare your documents. One setting that you may not be aware of is the Enhanced Matcher. This improves the matching of elements by evaluating the PCDATA in their subtrees. In your example, the Enhanced Matcher would cause the row in the second input to match with the second row of the first input based on the PCDATA inside it. To ensure the Enhanced Matcher is on, use the following line in your code:
assuming your PipelinedComparator instance is called 'pc' To further improve the matching when using the Enhanced Matcher, word by word comparison can be used. This requires the addition of an input filter and some output filters to the pipeline. If you are using Core 5.0, add com.deltaxml.pipe.filters.dx2.wbw.WordInfillter as the last input filter and com.deltaxml.pipe.filters.dx2.wbw.WordSpaceFixup and com.deltaxml.pipe.filters.dx2.wbw.WordOutfilter as the first two output filters. Take a look at http://www.deltaxml.com/free/examples/core-features/word-by-word for an explanation of word by word comparison. Hopefully this should help you solve your problem. If you are using your own input filters, try the comparison without them first to see if they are the cause of the problem. Do ask further questions if you are still having problems getting the correct result. Tristan | ||
| new topic post reply |
To find out about new replies to this post as they occur please subscribe to one of these feeds: | ![]() ![]() | moderate |
problem in deleting a element in the comparison
