Fix Xerces resource resolution for includes/imports
After we found a resource (like from an include/import), we reported the
location to Xerces incorrectly. For example, say we resolved the
systemID at
org1/xsd/payload.xsd
to the absolute URI at
file:/foo/bar/baz/org1/xsd/payload.xsd
When we created the new Input to return where we found payload.xsd to
Xerces, we set the systemID to the original relative systemID
(org/xsd/payload.xsd), and set the baseURI to the absolute URI
(file:/foo/bar/baz/org1/xsd/payload.xsd). To Xerces, this meant that the
resource was found at the first path relative to the second path. But
the first path relative to the second path is
file:/foo/bar/baz/org1/xsd/org1/xsd/payload.xsd
So parts of the path end up doubled, and Xerces cannot actually find the
resource. We thought this was a bug in Xerces and added heuristics to
remove these doubled paths, but upon further inspection, it was just a
bug in how we created Input's that Xerces used.
This patch fixes this so that the Input sets the systemId to the
resolved absolute URI, and does not set a baseURI. Xerces will not try
to do any relative stuff and the absolute resource will work. This also
means we can remove the heuristics that tried to remove doubled paths
(but which did not actually work in non-trivial cases).
Also, fix how arrayIndexStack and occursBoundsStack modifications are
undone when errors occurr with Arrays. Rather than the Array pushing and
a child rep parser popping on error, the array should do both the push
and pop. The logic was wrong before and things were not popped correctly
in some cases.
Added new test-stdLayout project for testing include/import.
This new project (within daffodil) is for testing the standard project
layout. In particular, there are include/import bugs associated with
it.
There is a test in scala-debug which fails with a path containing
.../org2/xsd/org2/xsd....
Which is clearly wrong given that the directory is
src/main/resources/org2/xsd
Tests cover cases where a schema file in
src/main/resources/org1/xsd tries to include one from
src/main/resources/org2/xsd.
And where a schema file in
src/test/resources/org2/xsd tries to include one from
src/main/resources/org2/xsd.
And where a TDML embedded schema tries to include one from
src/main/resources/org2/xsd.