Bug #4541
Updated by Michael Kay over 4 years ago
Raised on Slack at xml.com by Martin Honnen:
~~~
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mf="http://example.com/mf"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output method="html" indent="yes" html-version="5"/>
<xsl:template match="/" name="xsl:initial-template">
<html>
<head>
<title>Some xsl:param tests with as attribute</title>
</head>
<body>
<h1>Some <code>xsl:param</code> tests with <code>as</code> attribute</h1>
<section>
<h2>iteration parameter</h2>
<p><code>
<xsl:iterate select="1 to 5">
<xsl:param name="p1" as="xs:string" select="''"/>
<xsl:on-completion>
<xsl:copy-of select="$p1"/>
</xsl:on-completion>
<xsl:next-iteration>
<xsl:with-param name="p1"><item>test</item></xsl:with-param>
</xsl:next-iteration>
</xsl:iterate>
</code></p>
</section>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
~~~
The output with Saxon 10 HE is
~~~
<!DOCTYPE HTML><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Some xsl:param tests with as attribute</title>
</head>
<body>
<h1>Some <code>xsl:param</code> tests with <code>as</code> attribute</h1>
<section>
<h2>iteration parameter</h2>
<p><code>
<item>test</item></code></p>
</section>
</body>
</html>
~~~
with Exselt I only get a string and no element:
~~~
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Some xsl:param tests with as attribute</title>
</head>
<body>
<h1>Some <code>xsl:param</code> tests with <code>as</code> attribute
</h1>
<section>
<h2>iteration parameter</h2>
<p><code>test</code></p>
</section>
</body>
</html>
~~~
So it appears that the node supplied by `xsl:with-param` isn't being atomized as required by the `@as` option on `xsl:param`