https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2022-07-29T09:08:15ZSaxonica Developer CommunitySaxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=215002022-07-29T09:08:15ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>Linux doesn't work either:</p>
<pre><code>SaxonCS-11.4/SaxonCS validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 11.4 from Saxonica
.NET 5.0.13 on Linux
Using license serial number V...
URIResolver for schema file must return a Source
Exiting with code 2
</code></pre> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=223702023-01-09T16:24:14ZMichael Kaymike@saxonica.com
<ul></ul><p>Sorry that we've dropped the ball on this one.</p>
<p>On Mac I wasn't able to reproduce the problem in my (Rider) development environment, in either 11.x or 12.x.</p>
<p>On Linux we reproduced the problem on 11.4 (as issued).</p>
<p>I haven't tried it yet on Windows because my Windows machine is refusing to wake up after the Christmas holidays....</p>
<p>I downloaded a clean version of 11.4 on Mac and tried that from the command line. It loads the schema OK. If I try to validate a local document that works:</p>
<pre><code>SaxonCS-b6 validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:/Users/mike/Desktop/temp/test.xsd
</code></pre>
<p>But if I try to validate a remote document accessed over HTTP, I get a different failure:</p>
<pre><code>SaxonCS-b6 validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:http://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd -u
SaxonCS-EE 11.4 from Saxonica
.NET 6.0.3 on MacOS
Using license serial number V010895
Loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
Finished loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
Schema checking successful. Time: 835ms.
Memory used: 0Mb
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
</code></pre>
<p>I think this is bug <a class="issue tracker-1 status-3 priority-1 priority-lowest closed" title="Bug: NullPointerException running validate with incorrect arguments (Closed)" href="https://saxonica.plan.io/issues/5664">#5664</a>.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=223712023-01-09T17:54:24ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>I can still reproduce the error with 11.4 on Windows:</p>
<pre><code>PS C:\Users\marti> & 'C:\Program Files\Saxonica\SaxonCS-b6-11.4\SaxonCS-b6.exe' validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 11.4 from Saxonica
.NET 6.0.7 on Windows 10.0.22621.0
Using license serial number V...
...
URIResolver for schema file must return a Source
Exiting with code 2
</code></pre> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=223722023-01-09T18:09:13ZMichael Kaymike@saxonica.com
<ul></ul><p>Need to explore whether the problem also applies when loading a schema, via HTTP, that isn't one of the ones known to the standard catalog resolver.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=223732023-01-09T19:23:04ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>Here is another test:</p>
<pre><code>PS C:\Users\marti\OneDrive\Documents\XSD\assertion-attribute-sequence> & 'C:\Program Files\Saxonica\SaxonCS-b6-11.4\SaxonCS-b6.exe' validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://github.com/martin-honnen/martin-honnen.github.io/raw/master/xsd/sample1.xsd
SaxonCS-EE 11.4 from Saxonica
.NET 6.0.7 on Windows 10.0.22621.0
Using license serial number V...
...
URIResolver for schema file must return a Source
Exiting with code 2
</code></pre> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226442023-01-19T11:47:58ZMichael Kaymike@saxonica.com
<ul><li><strong>Assignee</strong> set to <i>Norm Tovey-Walsh</i></li></ul> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226852023-01-23T10:15:46ZNorm Tovey-Walsh
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226872023-01-23T10:47:26ZNorm Tovey-Walsh
<ul></ul><p>I'm trying with 12, not 11.4, and I'm getting different failures. On macOS:</p>
<pre><code>$ ./SaxonCS validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.12 on MacOS
Using license serial number V...
Loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
: An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Fatal error during validation: : An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Exiting with code 2
</code></pre>
<p>My first thought is that this is related to http->https redirection. I expect someone somewhere isn't following redirection to get the DTD.</p>
<p>On Linux, I get a different error:</p>
<pre><code>$ ./SaxonCS validate -t http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.13 on Linux
Using license serial number V010583
Validation error on line 13 column 2 of schema-for-xslt30.xsd:
XQDY0084: Cannot validate <Q{.../XMLSchema}schema>: no element declaration available
See https://www.w3.org/TR/xmlschema11-1/#cvc-elt clause 1
Validation error on line 56 column 2 of XMLSchema.xsd:
XQDY0084: Cannot validate <Q{.../XMLSchema}schema>: no element declaration available
See https://www.w3.org/TR/xmlschema11-1/#cvc-elt clause 1
</code></pre>
<p>Possibly the same underlying problem, though I can't explain why the results are different.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226882023-01-23T11:00:25ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>I get a similar error on Windows now with SaxonCS 12, much like your MacOs result:</p>
<pre><code>PS C:\Users\marti> & 'C:\Program Files\Saxonica\SaxonCS-12.0\SaxonCS.exe' validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.10 on Windows 10.0.22621.0
Using license serial number ..
..
Loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
: An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Fatal error during validation: : An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Exiting with code 2
</code></pre>
<p>For SaxonCS-b6-11.4 I continue to get the <code>URIResolver for schema file must return a Source</code>:</p>
<pre><code>PS C:\Users\marti> & 'C:\Program Files\Saxonica\SaxonCS-b6-11.4\SaxonCS-b6.exe' validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 11.4 from Saxonica
.NET 6.0.7 on Windows 10.0.22621.0
Using license serial number ..
..
URIResolver for schema file must return a Source
Exiting with code 2
</code></pre> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226902023-01-23T11:03:42ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>For my WSL Ubuntu Linux with 12 I get a similar error to the one on Windows or yours on MacOs:</p>
<pre><code>mh@LibertyDell:~$ SaxonCS-12.0/SaxonCS validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.13 on Linux
Using license serial number ..
Loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
: An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Fatal error during validation: : An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Exiting with code 2
</code></pre> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226972023-01-23T14:23:46ZNorm Tovey-Walsh
<ul></ul><p>Rider is really being very recalcitrant. I simply can't get the debugger to work and it's entirely unclear why.</p>
<p>A quick look at the XmlResolverCS project doesn't support the hypothesis that redirects aren't being followed. But it doesn remind me that I need to do a .NET 6 release. And apparently <code>WebClient</code> is deprecated so I should fix that.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226982023-01-23T15:15:30ZNorm Tovey-Walsh
<ul></ul><p>Even more weird, I can't now reproduce it with either a Debug or a Release build off he current main branch. Going back to the 12_0 tag to try that...</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=226992023-01-23T16:13:56ZNorm Tovey-Walsh
<ul></ul><p>The 12_0 tag didn't help. And it doesn't fail for me on Windows. Going back and trying the 11 branch on Windows next.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=227202023-01-24T11:41:03ZNorm Tovey-Walsh
<ul></ul><p>Taking a turn towards the even more confusing, I've discovered that the build target makes a difference.</p>
<p>If you just build the .NET app, you get a directory full of DLL files and an executable. If you run the command with that app, it works fine.</p>
<pre><code>$ pwd
/Volumes/Saxonica/src/saxonica/saxondev/build/cs/bin/Debug/net6.0/linux-x64
$ ./SaxonCS validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.13 on Linux
Using license serial number V010583
Loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
Finished loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
Schema checking successful. Time: 702ms.
Memory used: 4Mb
Processing https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
Validation time: 145ms.
Memory used: 2Mb
Validation successful
</code></pre>
<p>If you build the "publishable" version of the .NET app, you get a "single file" application which has (I think) all of the DLL files "compiled in". That version fails.</p>
<pre><code>$ cd publish
$ pwd
/Volumes/Saxonica/src/saxonica/saxondev/build/cs/bin/Debug/net6.0/linux-x64/publish
$ ./SaxonCS validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.13 on Linux
Using license serial number V010583
Loading schema document http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd
: An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Fatal error during validation: : An error has occurred while opening external DTD 'http://www.w3.org/TR/xmlschema11-1/XMLSchema.dtd': Value cannot be null. (Parameter 'path1')
Exiting with code 2
</code></pre>
<p>Not less confusing.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=227212023-01-24T14:13:16ZNorm Tovey-Walsh
<ul></ul><p>Okay. When running from the "just compiled" version that has all those separate DLLs, attempting to resolve the DTD finds it in the "data" DLL, <code>pack://application:,,,XmlResolverData;1.2.0;component/www...</code>.</p>
<p>When running from the "single file" version, either the data DLL isn't included or it isn't available. I still think the resolver should get the file from W3C but ...</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=227222023-01-24T15:48:30ZNorm Tovey-Walsh
<ul></ul><p>I have been attempting to load the data assembly by path name. That's not going to work when it's all compiled together. I'm not sure, on reflection, that it was a good idea anyway. A lot of getting <code>XmlResolverCS</code> working was trial and error.</p>
<p>It appears that I can load the assembly "by name". And if I leave the version out of the name, it finds the version that's compiled into the app.</p>
<p>In the meantime, if you download the XmlResolverData nuget package and put the data DLL from that in your current working directory, it might work :-)</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=227232023-01-24T17:22:36ZMartin Honnenmartin.honnen@gmx.de
<ul></ul><p>Norm Tovey-Walsh wrote in <a href="#note-16">#note-16</a>:</p>
<blockquote>
<p>In the meantime, if you download the XmlResolverData nuget package and put the data DLL from that in your current working directory, it might work :-)</p>
</blockquote>
<p>That seems to be true. So in the end the released Saxon 11.4 and 12.0 executables don't have the xmlresolverdata.dll included, only the xmlresolver.dll?</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=227252023-01-25T10:39:25ZNorm Tovey-Walsh
<ul></ul><p>No, the way I'm trying to load the data DLL doesn't work when the DLL is compiled into a single executable. I'm doing the lookup wrong, basically. I've just about got the resolver fixed so this should be fixed in 11.5 and 12.1.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=227322023-01-25T13:08:31ZNorm Tovey-Walsh
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>Applies to branch</strong> <i>12, trunk</i> added</li><li><strong>Fix Committed on Branch</strong> <i>11, 12, trunk</i> added</li></ul><p>Resolved with XmlResolver 2.0.0.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=229302023-02-08T16:25:31ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Fixed in Maintenance Release</strong> <i>11.5</i> added</li></ul><p>Bug fix applied in the Saxon 11.5 maintenance release.</p> Saxon - Bug #5624: SaxonCS.exe validate -t -xsd:http://www.w3.org/TR/xmlschema11-1/XMLSchema.xsd -s:https://www.w3.org/TR/xslt-30/schema-for-xslt30.xsd fails (at least on Windows) with URIResolver for schema file must return a Sourcehttps://saxonica.plan.io/issues/5624?journal_id=233102023-03-21T15:00:23ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in Maintenance Release</strong> <i>12.1</i> added</li></ul><p>Bug fix applied in the Saxon 12.1 maintenance release.</p>