Bug #4745
closedTesting for "the same" schema location is not sensitive to relative path
100%
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.
Updated by Michael Kay over 3 years ago
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.
Updated by Michael Kay over 3 years ago
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.
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from New to In Progress
Updated by Norm Tovey-Walsh over 3 years ago
- Fix Committed on Branch 10, trunk added
Fixed in 10 and trunk.
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from In Progress to Resolved
Updated by O'Neil Delpratt over 3 years ago
- 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.
Updated by O'Neil Delpratt over 3 years ago
Bug fix applied in the Saxon 10.3 maintenance release
Updated by O'Neil Delpratt over 3 years ago
- 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