Re: feeding docx into collection()

Martin Honnen <[email protected]> Wed, 25 Nov 2020 09:33:00 +0100
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
Am 25.11.2020 um 02:29 schrieb Graydon Saunders:
> Hello --
>
> https://www.saxonica.com/html/documentation/sourcedocs/collections.html
> <https://www.saxonica.com/html/documentation/sourcedocs/collections.html>
>
> says
>
> A URI is recognized as a ZIP or JAR file URI if the scheme name is
> "jar", or if the file extension is "zip" or "jar".
>
> Which means that I need to rename a docx archive to have a ".zip" suffix
> if I want to open it with collection().  Which is not especially
> challenging but which lacks elegance.
>
> Is there a way to explain to collection() that this URI is a zip
> archive, irrespective of suffix?

I think

To recognize additional kinds of ZIP file, for example Open Office
documents, write a subclass of StandardCollectionFinder that overrides
the method isJarFileURI().

is meant to suggest you have to write Java code, subclassing
https://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/resource/StandardCollectionFinder.html
and overriding
https://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/resource/StandardCollectionFinder.html#isJarFileURI-java.lang.String-
whose code is at
https://saxonica.plan.io/projects/saxon/repository/he/revisions/master/entry/latest10/hej/net/sf/saxon/resource/StandardCollectionFinder.java#L151
so you could write your own override checking for
   collectionURI.endsWith(".docx")
as well.



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