castor

org.castor.xmlctf.xmldiff.XMLDiff returns wrong value for namespace

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not A Bug
  • Affects Version/s: None
  • Fix Version/s: 1.3 rc1
  • Component/s: XML tests
  • Labels:
    None
  • Number of attachments :
    0

Description

XMLDiff result for two below fragments is 0 (identical)

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:myprefix="my.namespace.org" />

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:myprefix="your.namespace.org" />

Issue Links

Activity

Hide
Werner Guttmann added a comment -

Can you please attach a test case that I can use to replay this problem ?

Show
Werner Guttmann added a comment - Can you please attach a test case that I can use to replay this problem ?
Hide
Le Duc Bao added a comment -

I detected this error while I ran the CASTOR-2384. It's the test case NamespaceTest.testDiff() in the patch of CASTOR-2384

Show
Le Duc Bao added a comment - I detected this error while I ran the CASTOR-2384. It's the test case NamespaceTest.testDiff() in the patch of CASTOR-2384
Hide
Werner Guttmann added a comment -

Bao, I am actually not sure whether a namespace declaration should be part of the equality check. What difference would it make. XMLDIff compares nodes, based upon the qname definition of these nodes.

Show
Werner Guttmann added a comment - Bao, I am actually not sure whether a namespace declaration should be part of the equality check. What difference would it make. XMLDIff compares nodes, based upon the qname definition of these nodes.
Hide
Werner Guttmann added a comment -

Just added some more code to one of your tests, and Castor just recognizes fine any difference in namespace scope of e.g. a global element definition. As such, I don't think that XML namespace declarations should be made part of the equality comparison.

Show
Werner Guttmann added a comment - Just added some more code to one of your tests, and Castor just recognizes fine any difference in namespace scope of e.g. a global element definition. As such, I don't think that XML namespace declarations should be made part of the equality comparison.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: