Skip to content

Commit 85a3501

Browse files
committed
hopefully a workaround for ndw/xmlcalabash1#281 for the most common source of problems
1 parent 1c11307 commit 85a3501

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

xslt-mode/xpl/xslt-mode.xpl

+8-1
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,15 @@
128128
<p:choose name="adjust-doc-base-uri">
129129
<p:when test="$adjust-doc-base-uri = 'yes'">
130130
<p:output port="result" primary="true"/>
131+
<p:variable name="xml-base-att" select="/*/@xml:base"/>
131132
<p:xslt name="adjust-doc-base-uri1">
132-
<p:with-option name="output-base-uri" select="resolve-uri((base-uri(/*), base-uri())[1])"/>
133+
<p:documentation>With Saxon 9.7 and 9.8, base-uri(/*) can have a value that is different from base-uri()
134+
even when there is no xml:base attribute on /*.
135+
See https://github.com/ndw/xmlcalabash1/issues/281
136+
Using p:variable here because (base-uri(/*)[/*/@xml:base] resulted in an error:
137+
"Leading '/' selects nothing: the context item is not a node"</p:documentation>
138+
<p:with-option name="output-base-uri"
139+
select="resolve-uri((base-uri(/*)[normalize-space($xml-base-att)], base-uri())[1])"/>
133140
<p:input port="parameters"><p:empty/></p:input>
134141
<p:input port="stylesheet">
135142
<p:inline>

0 commit comments

Comments
 (0)