Re: Saxon on .NET: How to provide a XmlResolver for documents returned by collection()?

O'Neil Delpratt <oneil-JkSD5nQpfvpWk0Htik3J/[email protected]> Wed, 25 Nov 2020 22:55:04 +0000
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
Hi Emmanuel,

Thanks for reporting this bug issue. The .NET product does not have its own CollectionFinder, which it should have had as in the Java product.

I have created the following bug issue to track progress:

https://saxonica.plan.io/issues/4839 <https://saxonica.plan.io/issues/4839>

kind regards,

O'Neil

> On 25 Nov 2020, at 13:00, Emanuel Wlaschitz <[email protected]> wrote:
> 
> We've recently started to make more and more use of the collection() function and its ability to iterate files in a folder, which made a lot of custom C# code obsolete that we had to use in the past.
> While trying to replace (a lot more) code with (a lot less) XSLT calling collection(), we ran into the following error (which results in the transformation to fail): 
> 
> collection(): failed to parse XML file file:/D:/Test/sample1.xml: I/O error reported by XML parser processing file:/D:/Test/sample1.xml: Could not find file 'D:\Test\doctype.dtd'.
> 
> Obviously, that folder does not contain doctype.dtd (which is referenced by the DOCTYPE declaration of sample1.xml, as System ID); and for the most part we don't want (or need) it there.
> And for other purposes (which was mainly document() in the past) we've registered a XmlResolver as XsltTransformer.InputXmlResolver that redirects (and/or ignores) all requests for DTD or XSD files.
> 
> However, it appears the default CollectionFinder does not use XsltTransformer.InputXmlResolver; otherwise we wouldn't be seeing that error.
> We've also looked into implementing our own CollectionFinder (or rather: deriving from StandardCollectionFinder so we don't have to implement everything from scratch), but we couldn't find the appropriate place to plug in our code.
> The only thing that seemed remotely related was the context parameter in findCollection, but its uriResolver field was null.
> 
> And that's where our adventure ended, so we turned to the ML:
> 
> How can we get our custom XmlResolver into the default CollectionFinder?
> If that's not how it works, where would we plug our own code in a custom CollectionFinder?
> Also, after looking at "Writing your own Collection Finder": Is this even what we should be doing? The Collection Finder returns resources (as a sequence of URIs), not documents.
> 
> In case it matters, we've tried this on Saxon-HE 9.9.1.2N and 10.2N, but we plan on moving to 10.3N soon.
> 
> Thanks in advance,
> Emanuel
> 
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 

-------------------------------
O'Neil Delpratt
Software Developer, Saxonica Limited 
Email: oneil-JkSD5nQpfvpWk0Htik3J/[email protected]
Twitter: https://twitter.com/ond1
Tel: +447859044188
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help