Re: [basex-talk] XML catalog with fetch:xml
Thanks for your suggestions, Andy. If you (or anyone else) have already worked with custom resolvers for 3rd party libraries in Java, feel free to pass me on examples. They might help us to provide support for xmldb: or basex: URI schemes. Andy Bunce schrieb am Di., 25. Sep. 2018, 14:38: > Ok, Thanks for the info it is what I guessed, but I note the "currently" :) > > It would be good, long term, to look to matching the Saxon capabilties > here [1], part of which (xslt) are covered by this issue [2]. > > And related: I wonder sometimes about a "xmldb:" uri scheme and a custom > resolver that could be passed to 3rd party validation and transform > libraries to allow them to access BaseX db resources. I seem to remember a > number of issues on the list that could be related to the saving temp > copies of db resources to the file system as seems to occur currently. > > No doubt this would be a big task, if it is even possible :) > > /Andy > > [1] http://www.saxonica.com/documentation9.5/sourcedocs/xml-catalogs.html > [2] https://github.com/BaseXdb/basex/issues/1405 > > On 25 September 2018 at 09:28, Christian Grün > wrote: > >> Hi Andy, >> >> Currently, XML catalog files will only be evaluated by the XML parser, >> which will be called after the addressed resource has been located and >> retrieved. In other words: The specified catalog file will be >> evaluated indeed, but only for URIs that occur within the specified >> XML document: >> >> fetch:xml('file.xml', map { >> 'catfile': '/path/to/catalog.xml', >> 'dtd': true() >> }) >> >> file.xml: >> >> >> >> catalog.xml: >> > xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> >> > rewritePrefix="file:///path/to/dtd/" /> >> >> >> Hope this helps (a little), >> Christian >> >> >> On Tue, Sep 18, 2018 at 11:13 PM Andy Bunce wrote: >> > >> > Hi, >> > >> > Using a recent 9.1 Beta on windows. >> > I create an XML catalog at c:\tmp\mycatalog.xml >> > >> > > xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> >> > > > name="http://nowhere.com/doc; >> > uri="file:///c:/tmp/doc.xml" /> >> > >> > >> > Then in the GUI >> > >> > fetch:xml("http://nowhere.com/doc;, >> > map{"catfile": "C:\tmp\mycatalog.xml"} >> > ) >> > >> > It goes to nowhere, I was hoping to get back c:/tmp/doc.xml >> > Should this work? >> > >> > /Andy >> > >> > >
Re: [basex-talk] XML catalog with fetch:xml
Ok, Thanks for the info it is what I guessed, but I note the "currently" :) It would be good, long term, to look to matching the Saxon capabilties here [1], part of which (xslt) are covered by this issue [2]. And related: I wonder sometimes about a "xmldb:" uri scheme and a custom resolver that could be passed to 3rd party validation and transform libraries to allow them to access BaseX db resources. I seem to remember a number of issues on the list that could be related to the saving temp copies of db resources to the file system as seems to occur currently. No doubt this would be a big task, if it is even possible :) /Andy [1] http://www.saxonica.com/documentation9.5/sourcedocs/xml-catalogs.html [2] https://github.com/BaseXdb/basex/issues/1405 On 25 September 2018 at 09:28, Christian Grün wrote: > Hi Andy, > > Currently, XML catalog files will only be evaluated by the XML parser, > which will be called after the addressed resource has been located and > retrieved. In other words: The specified catalog file will be > evaluated indeed, but only for URIs that occur within the specified > XML document: > > fetch:xml('file.xml', map { > 'catfile': '/path/to/catalog.xml', > 'dtd': true() > }) > > file.xml: > > > > catalog.xml: > >rewritePrefix="file:///path/to/dtd/" /> > > > Hope this helps (a little), > Christian > > > On Tue, Sep 18, 2018 at 11:13 PM Andy Bunce wrote: > > > > Hi, > > > > Using a recent 9.1 Beta on windows. > > I create an XML catalog at c:\tmp\mycatalog.xml > > > > > >> name="http://nowhere.com/doc; > > uri="file:///c:/tmp/doc.xml" /> > > > > > > Then in the GUI > > > > fetch:xml("http://nowhere.com/doc;, > > map{"catfile": "C:\tmp\mycatalog.xml"} > > ) > > > > It goes to nowhere, I was hoping to get back c:/tmp/doc.xml > > Should this work? > > > > /Andy > > >
Re: [basex-talk] XML catalog with fetch:xml
Hi Andy, Currently, XML catalog files will only be evaluated by the XML parser, which will be called after the addressed resource has been located and retrieved. In other words: The specified catalog file will be evaluated indeed, but only for URIs that occur within the specified XML document: fetch:xml('file.xml', map { 'catfile': '/path/to/catalog.xml', 'dtd': true() }) file.xml: catalog.xml: Hope this helps (a little), Christian On Tue, Sep 18, 2018 at 11:13 PM Andy Bunce wrote: > > Hi, > > Using a recent 9.1 Beta on windows. > I create an XML catalog at c:\tmp\mycatalog.xml > > > name="http://nowhere.com/doc; > uri="file:///c:/tmp/doc.xml" /> > > > Then in the GUI > > fetch:xml("http://nowhere.com/doc;, > map{"catfile": "C:\tmp\mycatalog.xml"} > ) > > It goes to nowhere, I was hoping to get back c:/tmp/doc.xml > Should this work? > > /Andy >
[basex-talk] XML catalog with fetch:xml
Hi, Using a recent 9.1 Beta on windows. I create an XML catalog at c:\tmp\mycatalog.xml http://nowhere.com/doc; uri="file:///c:/tmp/doc.xml" /> Then in the GUI fetch:xml("http://nowhere.com/doc;, map{"catfile": "C:\tmp\mycatalog.xml"} ) It goes to nowhere, I was hoping to get back c:/tmp/doc.xml Should this work? /Andy