I spend some time with XMLUnit this morning and found that it suffered from the exact same problems as the current XMLEqualityChecker, namely that it was not able to see that xsi:type="customer:Customer" in one document is equivalent to xsi:type="ns0:Customer" in another. There are hooks for providing custom comparisons but these did not appear to behave in accordance with the documentation (I tried this with the 1.0 stable and 1.1 beta versions).
For now, I have made some more substantial changes to XMLEqualityChecker, as follows: - XMLEqualityChecker now sets the parser to be namespace aware - XMLEqualityChecker now throws a meaningful exception when a difference is encountered, rather than returning false - Special handling for xsi:type now compares the type name but ignores the namespace prefix The code changes are attached as a patch to https://issues.apache.org/jira/browse/TUSCANY-1351. I don't have committer rights yet so could someone apply this patch for me? I will continue to investigate XMLUnit to see if it is worth migrating to later on. Thanks, Andy. -----Original Message----- From: kelvin goodson [mailto:[EMAIL PROTECTED] Sent: 18 June 2007 14:49 To: [email protected]; [EMAIL PROTECTED] Subject: Re: [CTS] Removing namespace prefix assumptions from tests Thanks ant, it would indeed appear to be a BSD license. Here's the breadcrumb trail that, along with Ant's note, gives me the confidence to feel that it's ok to go ahead with this -- the apache page [1] is forwarded to [2] and [2] contains the section "Category A: Authorized Licenses", which contains a link to [3]. Kelvin. [1] http://www.apache.org/legal/3party.html [2] http://people.apache.org/~cliffs/3party.html [3] http://opensource.org/licenses/bsd-license.php On 18/06/07, ant elder <[EMAIL PROTECTED]> wrote: > > Its just a BSD license isn't it? And so fine to use. Infact we did at one > point use Xmlunit in some of the SCA WS testcases, not sure if thats still > the case. I'd say just go ahead and use it if it does what you need. > > ...ant > > On 6/18/07, kelvin goodson <[EMAIL PROTECTED]> wrote: > > > > Andy, to my eye the license looks OK, BUT, I'm not a lawyer and I can't > > speak for the ASF. I see that there is an Apache project providing tags > > for > > xmlunit [1], so that would give me a warm feeling, but looking in their > > distribution artifacts, they don't redistribute XMLUnit and therefore > > don't > > have the requirement to republish the XMLUnit license. > > > > I think we need to send a notice to [EMAIL PROTECTED] to check this out. > > Would you be happy to do that? If you are, it would probably be worth > > copying the Incubator Project Management Committee (IPMC) at > > [EMAIL PROTECTED] > > > > Regards, Kelvin. > > > > [1] http://jakarta.apache.org/commons/jelly/libs/xmlunit/index.html > > > > On 18/06/07, Andy Grove <[EMAIL PROTECTED]> wrote: > > > > > > XMLUnit does look like it would provide value. > > > > > > They have a proprietary license, pasted below. If you think this > license > > > would allow us to use it within the CTS then I'd be happy to spend > some > > > time > > > investigating this further. > > > > > > Thanks, > > > > > > Andy. > > > > > > /* > > > ****************************************************************** > > > Copyright (c) 2001-2007, Jeff Martin, Tim Bacon > > > All rights reserved. > > > > > > Redistribution and use in source and binary forms, with or without > > > modification, are permitted provided that the following conditions > > > are met: > > > > > > * Redistributions of source code must retain the above copyright > > > notice, this list of conditions and the following disclaimer. > > > * Redistributions in binary form must reproduce the above > > > copyright notice, this list of conditions and the following > > > disclaimer in the documentation and/or other materials provided > > > with the distribution. > > > * Neither the name of the xmlunit.sourceforge.net nor the names > > > of its contributors may be used to endorse or promote products > > > derived from this software without specific prior written > > > permission. > > > > > > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > > > "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > > > LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS > > > FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > > > COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > > > INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, > > > BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; > > > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > > > CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > > > LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN > > > ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > > > POSSIBILITY OF SUCH DAMAGE. > > > > > > ****************************************************************** > > > */ > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: kelvin goodson [mailto:[EMAIL PROTECTED] > > > Sent: 18 June 2007 11:38 > > > To: [email protected] > > > Subject: Re: [CTS] Removing namespace prefix assumptions from tests > > > > > > Hi Andy, > > > http://issues.apache.org/jira/browse/TUSCANY-1263 has a comment in > it > > > from > > > Lionel Villard ... > > > > > > "FYI, it exists an open source tool for comparing XML files: > > > http://xmlunit.sourceforge.net/ , I haven't tried it" > > > > > > I had been hoping to take a look at this, from both the technical and > > the > > > license aspects, but I haven't had the time yet. This may be a better > > way > > > to fix all these issues. If no-one has the bandwidth to look at this, > > > perhaps there's scope for tactical fixes such as that in your patch > that > > > would be superceded by the xmlunit dependency or the like. > > > > > > Regards, Kelvin. > > > > > > > > > > > > On 18/06/07, Andy Grove <[EMAIL PROTECTED]> wrote: > > > > > > > > XMLHelperTest.testDefineTypes() fails if an implementation does not > > > > specifically use the "customer" namespace prefix when serializing a > > > > document, even though it is equally valid for example to use the > > prefix > > > > "foo" or "ns0" to refer to the namespace. > > > > > > > > I have submitted a patch for TUSCANY-1351 that updates > > > XMLEqualityChecker > > > > so > > > > that it does not compare namespace prefixes on elements (but rather > > > > compares > > > > the namespace URI and the local name). > > > > > > > > Also, XMLEqualityChecker will no longer compare the value of > > attributes > > > > that use the "xmlns" or "xsi" prefixes. This is necessary because > > > > attributes > > > > such as xmlns:ns0="http://example.com/customer" and > > > > xsi:type="ns0:Customer" > > > > were deemd to be incorrect because they reference the namespace > prefix > > > > that > > > > differs from the one used in the gold xml file. > > > > > > > > This seems like a rather inelegant hack but I'm not sure how else to > > > > remove > > > > the tuscany-specific prefix assumptions without re-writing the test > or > > > > re-implementing XMLEqualityChecker to have more intelligence when > > > > comparing > > > > documents. > > > > > > > > Does anyone have any better suggestions for resolving this issue or > > > should > > > > I > > > > go ahead and apply this patch? > > > > > > > > Thanks, > > > > > > > > Andy. > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
