Skip to content

Commit

Permalink
hopefully a workaround for ndw/xmlcalabash1#281 for the most common s…
Browse files Browse the repository at this point in the history
…ource of problems
  • Loading branch information
gimsieke committed Oct 18, 2018
1 parent 1c11307 commit 85a3501
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xslt-mode/xpl/xslt-mode.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,15 @@
<p:choose name="adjust-doc-base-uri">
<p:when test="$adjust-doc-base-uri = 'yes'">
<p:output port="result" primary="true"/>
<p:variable name="xml-base-att" select="/*/@xml:base"/>
<p:xslt name="adjust-doc-base-uri1">
<p:with-option name="output-base-uri" select="resolve-uri((base-uri(/*), base-uri())[1])"/>
<p:documentation>With Saxon 9.7 and 9.8, base-uri(/*) can have a value that is different from base-uri()
even when there is no xml:base attribute on /*.
See https://github.com/ndw/xmlcalabash1/issues/281
Using p:variable here because (base-uri(/*)[/*/@xml:base] resulted in an error:
"Leading '/' selects nothing: the context item is not a node"</p:documentation>
<p:with-option name="output-base-uri"
select="resolve-uri((base-uri(/*)[normalize-space($xml-base-att)], base-uri())[1])"/>
<p:input port="parameters"><p:empty/></p:input>
<p:input port="stylesheet">
<p:inline>
Expand Down

1 comment on commit 85a3501

@gimsieke
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With XML Calabash 1.1.25 and Saxon 9.9.1.2, it has been tested to work without this workaround.

Please sign in to comment.