Bug #4745
closed
Testing for "the same" schema location is not sensitive to relative path
Applies to branch:
10, 9.9, trunk
Fix Committed on Branch:
10, 9.9, trunk
Fixed in Maintenance Release:
Description
Determining if two schema components are "the same" (and thus not a redeclaration of a component) can depend on determining whether or not the schema locations from which those components were loaded are "the same". If two components are loaded from the same URI, they are assumed to be the same component.
However, it is possible for the relative locations to have URIs that appear to be different: file:/path/to/schema.xsd
in one case and file:/path/to/subdirectory/../schema.xsd
in the other. (This case arises in the junit Validator tests, for example).
Differences in relative paths should be normalized when comparing locations.
Makes sense.
Note there's a static method DocumentKey.normalizeURI() used for a similar purpose - detecting when doc() uses the URI of something already in cache. it seems to handle some ignorable differences between equivalent URIs, but not this one. I'd suggest improving that method and using it.
Note also, for Element declarations the code moved away from comparing components by source location, and instead does a value-based comparison (ElementDecl.isSameDeclaration()
). But for other kinds of component, e.g.attribute declarations and types (UserDefinedType.isSameType()
) it's still location-based. In general doing a value-based comparison is hard, because we're in the middle of a network of related components, not just a hierarchy. I think Element Declarations were special cased to make xs:override
work, but I don't recall the details.
- Status changed from New to In Progress
- Fix Committed on Branch 10, trunk added
- Fix Committed on Branch 9.9 added
- Status changed from In Progress to Resolved
- Fixed in Maintenance Release 9.9.1.8 added
Bug fix applied on the Saxon 9.9.1.8 maintenance release. Leaving open until applied on the Saxon 10 maintenance release.
Bug fix applied in the Saxon 10.3 maintenance release
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.3 added
Please register to edit this issue
Also available in: Atom
PDF