Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With 1.1.26-99, a new error for the test case in #281 appears #289

Open
gimsieke opened this issue Apr 4, 2019 · 3 comments
Open

With 1.1.26-99, a new error for the test case in #281 appears #289

gimsieke opened this issue Apr 4, 2019 · 3 comments

Comments

@gimsieke
Copy link
Contributor

gimsieke commented Apr 4, 2019

In the same area of our EPUB converter where #281 and #288 appeared, there was now a new error.
There is a p:iteration-source that iterates over resources whose base URI is supposed to end in .css or .xhtml. The .css resources are created by an XSLT named …/css-tools/xsl/css-generate.xsl. With 1.1.26-99, after the first .css resource has been iterated over, the next resource has a base URI that ends in css-tools/xsl/css-generate.xsl which leads to subsequent errors (“tr:ext-to-mime-type(): Empty type for 'xsl'”).

I haven’t prepared a minimal repro yet, but I noticed that the repro of #281 now throws the following error:

$ java -jar xmlcalabash-1.1.26-99.jar -i source=../Untitled2.xml ../issue281.xpl
Message: before:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled2.xml,  /*/@xml:base: file:/foo/bar.xml,  base-uri(/*): file:/foo/bar.xml
ERROR: file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/issue281.xpl:27:15:err:XD0026:Expression refers to context when none is available: ' after:   base-uri(): ',   base-uri(),                      ',  /*/@xml:base: ', /*/@xml:base,                      ',  base-uri(/*): ', base-uri(/*)
ERROR: It is a dynamic error if the select expression makes reference to the context node, size, or position when the context item is undefined.

With 1.1.25-99, it’s still:

Message: before:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled2.xml,  /*/@xml:base: file:/foo/bar.xml,  base-uri(/*): file:/foo/bar.xml
Message:  after:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled2.xml,  /*/@xml:base: ,  base-uri(/*):

This seems to be related to p:xslt not producing any output. If I modify Untitled3.xsl so that it produces a primary output, the base URIs that 1.1.26-99 reports are:

Message:  after:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled2.xml,  /*/@xml:base: ,  base-uri(/*): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled3.xsl

With 1.1.25-99:

Message:  after:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled2.xml,  /*/@xml:base: ,  base-uri(/*): file:/C:/cygwin/home/gerrit/Dev/tmp/Calabash/Untitled2.xml

So the primary output gets again the base URI of the XSLT stylesheet.

@ndw
Copy link
Owner

ndw commented Apr 6, 2019

Ok. The raw destination that I had to use to fix the previous issue doesn't allow me to specify the base URI of the output document (so I guess it gets the stylesheet URI). I thought this was rectified before the document was returned, but perhaps there's a case where it isn't. I'll investigate.

@ndw
Copy link
Owner

ndw commented Jun 2, 2019

#281 now runs without error for me (with the latest Saxon 9.9). Works for you now?

@gimsieke
Copy link
Contributor Author

gimsieke commented Jun 25, 2019

It doesn’t throw an error any more when I run it with Saxon 9.9.1.2 or 9.9.1.3 and Calabash 1.1.26-99 or 1.1.27-99, but in all cases the result is like

$ java -jar xmlcalabash-1.1.27-99.jar  -i source=../../../Untitled2.xml ../../../issue281.xpl
Message: before:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/Calabash/Untitled2.xml,  /*/@xml:base: file:/foo/bar.xml,  base-uri(/*): file:/foo/bar.xml
Message:  after:   base-uri(): file:/C:/cygwin/home/gerrit/Dev/Calabash/Untitled2.xml,  /*/@xml:base: ,  base-uri(/*): file:/C:/cygwin/home/gerrit/Dev/Calabash/Untitled3.xsl
<doc/>

which means that after the transformation, base-uri(/*) is the base URI of the stylesheet while it needs to be identical to base-uri() in the absence of /*/@xml:base. This was the error that I reported in #281.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants