Yes, this is definitely a bug. I'm thinking about how best to fix it.
 
Note however that the spec is not exactly the way you imagine it.
 
What should happen is that the xs:QName value passed in $elementName is converted to a string. This string is in the form of a lexical QName (prefix:localname). Because you specified the namespace attribute, the prefix part of the lexical QName should be used as the suggested prefix for the constructed element.
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



From: Jan Kovařík [mailto:kovarikjan@gmail.com]
Sent: 07 September 2009 11:52
To: saxon-help@lists.sourceforge.net
Subject: [saxon] version 9.2 bug?

Hi,

im trying new Saxon-HE version and im getting error: Required item type of @name attribute of element is xs:string; supplied value has item type xs:QName(in saxon-B it was ok).
In this function:
<xsl:function name="functx:wrap-values-in-elements" as="element()*"
              xmlns:functx="http://www.functx.com" >
  <xsl:param name="values" as="xs:anyAtomicType*"/>
  <xsl:param name="elementName" as="xs:QName"/>
 
   <xsl:for-each select="$values">
     <xsl:element name="{$elementName}"
                  namespace="{namespace-uri-from-QName($elementName)}">
       <xsl:sequence select="."/>
     </xsl:element>
   </xsl:for-each>
 
</xsl:function>

i Was looking to w3c recommendation and i saw there, that Qname is ok. So am I missing something?
<xsl:element
  name = { qname }
  namespace = { uri-reference }
  use-attribute-sets = qnames>
  <!-- Content: template -->
</xsl:element>

thank you for your help.