Catalog Resolution Under Windows
Saturday, 12 March 2016 · 11 messages · last reply 21 Mar 2016
EK
Eliot Kimber12 Mar 2016 10:11 #
I'm trying to make BaseX work under Windows 7 and I don't seem to be able to get catalog resolution to work. (I'm doing a workshop in Japan and the classroom only has 32-bit Windows machines available--since Docker requires 64-bit Windows I'm having to scramble to make the same code work directly under Windows 7 32-bit--ugh.)
I'm using BaseX 8.4.1 with Java 8 (the Java supplied with the 32-bit version of oXygenXML).
In my .basex file I have these entries:
CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml"
DTD = true
SKIPCORRUPT = true
CHOP = false
Using the DBA Web app I can see that the CATFILE property is set to that value, DTD is checked, CHOP is unchecked, and SKIPCORRUPT is checked, so my settings are clearly being used.
However, if I create a database and use the DBA app to load a document that uses a DTD mapped by the catalog (e.g., a DITA document), load fails with a "Can't resolve DTD" message.
The document is valid according to oXygen (and it's the same catalog--this is the OT oXygen is using) and of course my OS X and Docker-based versions of the same setup work fine, so it looks like a Windows-specific issue.
Is there any known issue with catalog resolution under Windows? Is there anything I can do to try to debug the problem?
Thanks,
Eliot
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.comEK
Eliot Kimber13 Mar 2016 01:05 #
I tried some more experiments.
I used the BaseX GUI as follows:
1. Created a new database and used the GUI to select the catalog file directly.
2. Used the add function from the New Database dialog to load a directory, selecting all the .xml, .dita, and .ditamap files.
All the DITA files were skipped.
I did the same test using 8.4.1 under OS X but against the same source files and catalog and it worked fine.
So this seems to be a general issue with catalog resolution under Windows.
Cheers,
E.
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com
On 3/12/16, 6:11 PM, "Eliot Kimber"
<basex-talk-bounces at mailman.uni-konstanz.de on behalf of
Quoted text · Eliot Kimber · 45 lines
ekimber at contrext.com> wrote: >I'm trying to make BaseX work under Windows 7 and I don't seem to be able >to get catalog resolution to work. (I'm doing a workshop in Japan and the >classroom only has 32-bit Windows machines available--since Docker >requires 64-bit Windows I'm having to scramble to make the same code work >directly under Windows 7 32-bit--ugh.) > >I'm using BaseX 8.4.1 with Java 8 (the Java supplied with the 32-bit >version of oXygenXML). > >In my .basex file I have these entries: > >CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >DTD = true >SKIPCORRUPT = true >CHOP = false > > >Using the DBA Web app I can see that the CATFILE property is set to that >value, DTD is checked, CHOP is unchecked, and SKIPCORRUPT is checked, so >my settings are clearly being used. > >However, if I create a database and use the DBA app to load a document >that uses a DTD mapped by the catalog (e.g., a DITA document), load fails >with a "Can't resolve DTD" message. > >The document is valid according to oXygen (and it's the same catalog--this >is the OT oXygen is using) and of course my OS X and Docker-based versions >of the same setup work fine, so it looks like a Windows-specific issue. > >Is there any known issue with catalog resolution under Windows? Is there >anything I can do to try to debug the problem? > >Thanks, > >Eliot > >---- >Eliot Kimber, Owner >Contrext, LLC >http://contrext.com > > > >
EK
Eliot Kimber13 Mar 2016 01:13 #
I tried the same experiment on Windows 10 and got the same failure result as on Windows 7. Java is:
C:\WINDOWS\system32>java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)
Cheers,
Eliot
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com
Quoted text · Eliot Kimber · 81 lines
On 3/13/16, 9:05 AM, "Eliot Kimber" <ekimber at contrext.com> wrote: >I tried some more experiments. > >I used the BaseX GUI as follows: > >1. Created a new database and used the GUI to select the catalog file >directly. >2. Used the add function from the New Database dialog to load a directory, >selecting all the .xml, .dita, and .ditamap files. > >All the DITA files were skipped. > >I did the same test using 8.4.1 under OS X but against the same source >files and catalog and it worked fine. > >So this seems to be a general issue with catalog resolution under Windows. > >Cheers, > >E. >---- >Eliot Kimber, Owner >Contrext, LLC >http://contrext.com > > > > >On 3/12/16, 6:11 PM, "Eliot Kimber" ><basex-talk-bounces at mailman.uni-konstanz.de on behalf of >ekimber at contrext.com> wrote: > >>I'm trying to make BaseX work under Windows 7 and I don't seem to be able >>to get catalog resolution to work. (I'm doing a workshop in Japan and the >>classroom only has 32-bit Windows machines available--since Docker >>requires 64-bit Windows I'm having to scramble to make the same code work >>directly under Windows 7 32-bit--ugh.) >> >>I'm using BaseX 8.4.1 with Java 8 (the Java supplied with the 32-bit >>version of oXygenXML). >> >>In my .basex file I have these entries: >> >>CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >>DTD = true >>SKIPCORRUPT = true >>CHOP = false >> >> >>Using the DBA Web app I can see that the CATFILE property is set to that >>value, DTD is checked, CHOP is unchecked, and SKIPCORRUPT is checked, so >>my settings are clearly being used. >> >>However, if I create a database and use the DBA app to load a document >>that uses a DTD mapped by the catalog (e.g., a DITA document), load fails >>with a "Can't resolve DTD" message. >> >>The document is valid according to oXygen (and it's the same >>catalog--this >>is the OT oXygen is using) and of course my OS X and Docker-based >>versions >>of the same setup work fine, so it looks like a Windows-specific issue. >> >>Is there any known issue with catalog resolution under Windows? Is there >>anything I can do to try to debug the problem? >> >>Thanks, >> >>Eliot >> >>---- >>Eliot Kimber, Owner >>Contrext, LLC >>http://contrext.com >> >> >> >> > > >
IL
Imsieke, Gerrit, le-tex13 Mar 2016 09:19 #
Hi Eliot,
I didn’t recently try it on Windows myself, but just two observations.
Quoted text · Eliot Kimber · 2 lines
On 13.03.2016 01:13, Eliot Kimber wrote: > CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml"
There is a trailing quote sign here, is this intentional? Don’t know the effects of unbalanced quotes here.
In any case, it might be necessary to give the location as a file: URI, as in file:///C:/workspace/DITA-OT2.x/catalog-dita.xml
Did you already try that?
Gerrit
EK
Eliot Kimber13 Mar 2016 09:27 #
I was just trying that now (the trailing quote was my typo but was also a red herring).
Yes, the value must be a URL and I've verified that using file:/c:/... works.
I'm trying to put together a code patch that does this automatically when a normal filename is specified because this is pretty bad Simon Says behavior. It doesn't help that the Javadoc for the Apache CatalogManager isn't itself explicit that the catalog files property is in fact URLs, not OS-specific file paths.
Cheers,
E.
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com
On 3/13/16, 5:19 PM, "Imsieke, Gerrit, le-tex"
<basex-talk-bounces at mailman.uni-konstanz.de on behalf of
Quoted text · Imsieke, Gerrit, le-tex · 17 lines
gerrit.imsieke at le-tex.de> wrote: >Hi Eliot, > >I didn¹t recently try it on Windows myself, but just two observations. > >On 13.03.2016 01:13, Eliot Kimber wrote: >> CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" > >There is a trailing quote sign here, is this intentional? Don¹t know the >effects of unbalanced quotes here. > >In any case, it might be necessary to give the location as a file: URI, >as in file:///C:/workspace/DITA-OT2.x/catalog-dita.xml >Did you already try that? > >Gerrit >
KS
Kendall Shaw13 Mar 2016 21:02 #
I remember trying to figure out if the catalog files are supposed to be URIs or file paths (in commons resolver), and I think it was Catalog.parseCatalogFile that had a problem. It tries essentially:
catalogPath = path.replace(‘\\', ‘/‘)
new URL(baseURL, catalogPath)
and if that is a malformed URL, it tries:
new URL(“file:”, catalogPath)
So, with a canonical windows file path, the URL that it uses is:
file:c:/somewhere/some.file
And then later somewhere that URL is not resolved.
Kendall
Quoted text · basex-talk-bounces at mailman.uni-konstanz.de on behalf of Eliot Kimber · 47 lines
On 3/13/16, 12:27 AM, "basex-talk-bounces at mailman.uni-konstanz.de on behalf of Eliot Kimber" <basex-talk-bounces at mailman.uni-konstanz.de on behalf of ekimber at contrext.com> wrote: >I was just trying that now (the trailing quote was my typo but was also a >red herring). > >Yes, the value must be a URL and I've verified that using file:/c:/... >works. > >I'm trying to put together a code patch that does this automatically when >a normal filename is specified because this is pretty bad Simon Says >behavior. It doesn't help that the Javadoc for the Apache CatalogManager >isn't itself explicit that the catalog files property is in fact URLs, not >OS-specific file paths. > >Cheers, > >E. > >---- >Eliot Kimber, Owner >Contrext, LLC >http://contrext.com > > > > >On 3/13/16, 5:19 PM, "Imsieke, Gerrit, le-tex" ><basex-talk-bounces at mailman.uni-konstanz.de on behalf of >gerrit.imsieke at le-tex.de> wrote: > >>Hi Eliot, >> >>I didn¹t recently try it on Windows myself, but just two observations. >> >>On 13.03.2016 01:13, Eliot Kimber wrote: >>> CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >> >>There is a trailing quote sign here, is this intentional? Don¹t know the >>effects of unbalanced quotes here. >> >>In any case, it might be necessary to give the location as a file: URI, >>as in file:///C:/workspace/DITA-OT2.x/catalog-dita.xml >>Did you already try that? >> >>Gerrit >> > >
KS
Kendall Shaw13 Mar 2016 21:03 #
new URL(“file:” + catalogPath)
Appending text together seems to not be the best way to construct a URI.
Quoted text · basex-talk-bounces at mailman.uni-konstanz.de on behalf of Kendall Shaw · 70 lines
On 3/13/16, 1:02 PM, "basex-talk-bounces at mailman.uni-konstanz.de on behalf of Kendall Shaw" <basex-talk-bounces at mailman.uni-konstanz.de on behalf of kendall.shaw at workday.com> wrote: >I remember trying to figure out if the catalog files are supposed to be URIs or file paths (in commons resolver), and I think it was Catalog.parseCatalogFile that had a problem. It tries essentially: > >catalogPath = path.replace(‘\\', ‘/‘) > >new URL(baseURL, catalogPath) > >and if that is a malformed URL, it tries: > >new URL(“file:”, catalogPath) > >So, with a canonical windows file path, the URL that it uses is: > >file:c:/somewhere/some.file > > > > >And then later somewhere that URL is not resolved. > >Kendall > >On 3/13/16, 12:27 AM, "basex-talk-bounces at mailman.uni-konstanz.de on behalf of Eliot Kimber" <basex-talk-bounces at mailman.uni-konstanz.de on behalf of ekimber at contrext.com> wrote: > >>I was just trying that now (the trailing quote was my typo but was also a >>red herring). >> >>Yes, the value must be a URL and I've verified that using file:/c:/... >>works. >> >>I'm trying to put together a code patch that does this automatically when >>a normal filename is specified because this is pretty bad Simon Says >>behavior. It doesn't help that the Javadoc for the Apache CatalogManager >>isn't itself explicit that the catalog files property is in fact URLs, not >>OS-specific file paths. >> >>Cheers, >> >>E. >> >>---- >>Eliot Kimber, Owner >>Contrext, LLC >>http://contrext.com >> >> >> >> >>On 3/13/16, 5:19 PM, "Imsieke, Gerrit, le-tex" >><basex-talk-bounces at mailman.uni-konstanz.de on behalf of >>gerrit.imsieke at le-tex.de> wrote: >> >>>Hi Eliot, >>> >>>I didn¹t recently try it on Windows myself, but just two observations. >>> >>>On 13.03.2016 01:13, Eliot Kimber wrote: >>>> CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >>> >>>There is a trailing quote sign here, is this intentional? Don¹t know the >>>effects of unbalanced quotes here. >>> >>>In any case, it might be necessary to give the location as a file: URI, >>>as in file:///C:/workspace/DITA-OT2.x/catalog-dita.xml >>>Did you already try that? >>> >>>Gerrit >>> >> >>
EK
This code would fail to construct a good Windows file: URL because it misses out the "/" after the "file:".
Cheers,
E.
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com
On 3/14/16, 5:02 AM, "Kendall Shaw"
<basex-talk-bounces at mailman.uni-konstanz.de on behalf of
Quoted text · Kendall Shaw · 75 lines
kendall.shaw at workday.com> wrote: >I remember trying to figure out if the catalog files are supposed to be >URIs or file paths (in commons resolver), and I think it was >Catalog.parseCatalogFile that had a problem. It tries essentially: > >catalogPath = path.replace(‘\\', ‘/‘) > >new URL(baseURL, catalogPath) > >and if that is a malformed URL, it tries: > >new URL(“file:”, catalogPath) > >So, with a canonical windows file path, the URL that it uses is: > >file:c:/somewhere/some.file > > > > >And then later somewhere that URL is not resolved. > >Kendall > >On 3/13/16, 12:27 AM, "basex-talk-bounces at mailman.uni-konstanz.de on >behalf of Eliot Kimber" <basex-talk-bounces at mailman.uni-konstanz.de on >behalf of ekimber at contrext.com> wrote: > >>I was just trying that now (the trailing quote was my typo but was also a >>red herring). >> >>Yes, the value must be a URL and I've verified that using file:/c:/... >>works. >> >>I'm trying to put together a code patch that does this automatically when >>a normal filename is specified because this is pretty bad Simon Says >>behavior. It doesn't help that the Javadoc for the Apache CatalogManager >>isn't itself explicit that the catalog files property is in fact URLs, >>not >>OS-specific file paths. >> >>Cheers, >> >>E. >> >>---- >>Eliot Kimber, Owner >>Contrext, LLC >>http://contrext.com >> >> >> >> >>On 3/13/16, 5:19 PM, "Imsieke, Gerrit, le-tex" >><basex-talk-bounces at mailman.uni-konstanz.de on behalf of >>gerrit.imsieke at le-tex.de> wrote: >> >>>Hi Eliot, >>> >>>I didn¹t recently try it on Windows myself, but just two observations. >>> >>>On 13.03.2016 01:13, Eliot Kimber wrote: >>>> CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >>> >>>There is a trailing quote sign here, is this intentional? Don¹t know the >>>effects of unbalanced quotes here. >>> >>>In any case, it might be necessary to give the location as a file: URI, >>>as in file:///C:/workspace/DITA-OT2.x/catalog-dita.xml >>>Did you already try that? >>> >>>Gerrit >>> >> >>
CG
Hi Eliot,
I spent some time to find out what might have gone wrong in your scenario. I created a little, self-contained BaseX command script, which seems to work out of the box with Windows. Could you please give it a try and modify it such that I can see what goes wrong?
You can change the value of the 'catfile' option to an absolute path with forward or backward slashes, it shouldn’t make a difference.
Thanks in advance
Christian
Quoted text · Eliot Kimber · 44 lines
On Sat, Mar 12, 2016 at 10:11 AM, Eliot Kimber <ekimber at contrext.com> wrote: > I'm trying to make BaseX work under Windows 7 and I don't seem to be able > to get catalog resolution to work. (I'm doing a workshop in Japan and the > classroom only has 32-bit Windows machines available--since Docker > requires 64-bit Windows I'm having to scramble to make the same code work > directly under Windows 7 32-bit--ugh.) > > I'm using BaseX 8.4.1 with Java 8 (the Java supplied with the 32-bit > version of oXygenXML). > > In my .basex file I have these entries: > > CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" > DTD = true > SKIPCORRUPT = true > CHOP = false > > > Using the DBA Web app I can see that the CATFILE property is set to that > value, DTD is checked, CHOP is unchecked, and SKIPCORRUPT is checked, so > my settings are clearly being used. > > However, if I create a database and use the DBA app to load a document > that uses a DTD mapped by the catalog (e.g., a DITA document), load fails > with a "Can't resolve DTD" message. > > The document is valid according to oXygen (and it's the same catalog--this > is the OT oXygen is using) and of course my OS X and Docker-based versions > of the same setup work fine, so it looks like a Windows-specific issue. > > Is there any known issue with catalog resolution under Windows? Is there > anything I can do to try to debug the problem? > > Thanks, > > Eliot > > ---- > Eliot Kimber, Owner > Contrext, LLC > http://contrext.com > > >
CG
Hi Eliot,
Thanks for the swift response. Interestingly, I can use a loca, absolute file path for CATFILE and Windows (10), and it works perfectly for me. Did you possibly have a look at the .bxs example?
Cheers,
Christian
Quoted text · Eliot Kimber · 91 lines
On Mon, Mar 21, 2016 at 2:03 PM, Eliot Kimber <ekimber at contrext.com> wrote: > The issue was entirely the syntax of the URL for the catalog file. Once I > used "file:/c:/foo/bar/catalog-dita.xml" then it worked reliably. > > The catalog resolver requires a URL and unless I was looking at the wrong > BaseX code there was nothing in there to correct "\" to "/" before passing > the value to the catalog manager. > > Cheers, > > E. > > ---- > Eliot Kimber, Owner > Contrext, LLC > http://contrext.com > > > > > On 3/21/16, 7:46 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: > >>Hi Eliot, >> >>I spent some time to find out what might have gone wrong in your >>scenario. I created a little, self-contained BaseX command script, >>which seems to work out of the box with Windows. Could you please give >>it a try and modify it such that I can see what goes wrong? >> >>You can change the value of the 'catfile' option to an absolute path >>with forward or backward slashes, it shouldn¹t make a difference. >> >>Thanks in advance >>Christian >> >> >> >> >>On Sat, Mar 12, 2016 at 10:11 AM, Eliot Kimber <ekimber at contrext.com> >>wrote: >>> I'm trying to make BaseX work under Windows 7 and I don't seem to be >>>able >>> to get catalog resolution to work. (I'm doing a workshop in Japan and >>>the >>> classroom only has 32-bit Windows machines available--since Docker >>> requires 64-bit Windows I'm having to scramble to make the same code >>>work >>> directly under Windows 7 32-bit--ugh.) >>> >>> I'm using BaseX 8.4.1 with Java 8 (the Java supplied with the 32-bit >>> version of oXygenXML). >>> >>> In my .basex file I have these entries: >>> >>> CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >>> DTD = true >>> SKIPCORRUPT = true >>> CHOP = false >>> >>> >>> Using the DBA Web app I can see that the CATFILE property is set to that >>> value, DTD is checked, CHOP is unchecked, and SKIPCORRUPT is checked, so >>> my settings are clearly being used. >>> >>> However, if I create a database and use the DBA app to load a document >>> that uses a DTD mapped by the catalog (e.g., a DITA document), load >>>fails >>> with a "Can't resolve DTD" message. >>> >>> The document is valid according to oXygen (and it's the same >>>catalog--this >>> is the OT oXygen is using) and of course my OS X and Docker-based >>>versions >>> of the same setup work fine, so it looks like a Windows-specific issue. >>> >>> Is there any known issue with catalog resolution under Windows? Is there >>> anything I can do to try to debug the problem? >>> >>> Thanks, >>> >>> Eliot >>> >>> ---- >>> Eliot Kimber, Owner >>> Contrext, LLC >>> http://contrext.com >>> >>> >>> > >
EK
The issue was entirely the syntax of the URL for the catalog file. Once I used "file:/c:/foo/bar/catalog-dita.xml" then it worked reliably.
The catalog resolver requires a URL and unless I was looking at the wrong BaseX code there was nothing in there to correct "\" to "/" before passing the value to the catalog manager.
Cheers,
E.
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com
Quoted text · Christian Grün · 68 lines
On 3/21/16, 7:46 AM, "Christian Grün" <christian.gruen at gmail.com> wrote: >Hi Eliot, > >I spent some time to find out what might have gone wrong in your >scenario. I created a little, self-contained BaseX command script, >which seems to work out of the box with Windows. Could you please give >it a try and modify it such that I can see what goes wrong? > >You can change the value of the 'catfile' option to an absolute path >with forward or backward slashes, it shouldn¹t make a difference. > >Thanks in advance >Christian > > > > >On Sat, Mar 12, 2016 at 10:11 AM, Eliot Kimber <ekimber at contrext.com> >wrote: >> I'm trying to make BaseX work under Windows 7 and I don't seem to be >>able >> to get catalog resolution to work. (I'm doing a workshop in Japan and >>the >> classroom only has 32-bit Windows machines available--since Docker >> requires 64-bit Windows I'm having to scramble to make the same code >>work >> directly under Windows 7 32-bit--ugh.) >> >> I'm using BaseX 8.4.1 with Java 8 (the Java supplied with the 32-bit >> version of oXygenXML). >> >> In my .basex file I have these entries: >> >> CATFILE = C:/workspace/DITA-OT2.x/catalog-dita.xml" >> DTD = true >> SKIPCORRUPT = true >> CHOP = false >> >> >> Using the DBA Web app I can see that the CATFILE property is set to that >> value, DTD is checked, CHOP is unchecked, and SKIPCORRUPT is checked, so >> my settings are clearly being used. >> >> However, if I create a database and use the DBA app to load a document >> that uses a DTD mapped by the catalog (e.g., a DITA document), load >>fails >> with a "Can't resolve DTD" message. >> >> The document is valid according to oXygen (and it's the same >>catalog--this >> is the OT oXygen is using) and of course my OS X and Docker-based >>versions >> of the same setup work fine, so it looks like a Windows-specific issue. >> >> Is there any known issue with catalog resolution under Windows? Is there >> anything I can do to try to debug the problem? >> >> Thanks, >> >> Eliot >> >> ---- >> Eliot Kimber, Owner >> Contrext, LLC >> http://contrext.com >> >> >>
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery