This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Test case K2-DirectConElemNamespace-76 in XQTS contains the following query: <e xmlns:p="{{1}}"/> The XQueryX generated by the XQuery 1.0 applet for this query is: <?xml version="1.0"?> <xqx:module xmlns:xqx="http://www.w3.org/2005/XQueryX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2005/XQueryX http://www.w3.org/2005/XQueryX/xqueryx.xsd"> <xqx:mainModule> <xqx:queryBody> <xqx:elementConstructor> <xqx:tagName>e</xqx:tagName> <xqx:attributeList> <xqx:namespaceDeclaration> <xqx:prefix>p</xqx:prefix> <xqx:uri>{1}</xqx:uri> </xqx:namespaceDeclaration> </xqx:attributeList> </xqx:elementConstructor> </xqx:queryBody> </xqx:mainModule> </xqx:module> The application of our xqueryx.xsl stylesheet to this XQueryX generates the following: <e xmlns:p="{1}"></e> This generated query was recently determined to be invalid (see Bug #5083). I suggest that the xqueryx.xsl stylesheet needs to be changed. I note that the template for xqx:attributeConstructor converts { and } to {{ and }}, respectively. The template for xqx:namespaceDeclaration does not do this.
This could be solved by changing the template for xqx:namespaceDeclaration from: <xsl:template match="xqx:namespaceDeclaration"> <xsl:text> xmlns</xsl:text> <xsl:if test="xqx:prefix"> <xsl:text>:</xsl:text> <xsl:value-of select="xqx:prefix"/> </xsl:if> <xsl:value-of select="$EQUAL"/> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:uri"/> </xsl:call-template> </xsl:template> to the following: <xsl:template match="xqx:namespaceDeclaration"> <xsl:text> xmlns</xsl:text> <xsl:if test="xqx:prefix"> <xsl:text>:</xsl:text> <xsl:value-of select="xqx:prefix"/> </xsl:if> <xsl:value-of select="$EQUAL"/> <xsl:call-template name="quote"> <xsl:with-param name="item"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:value-of select="xqx:uri"/> </xsl:with-param> <xsl:with-param name="toBeReplaced"><xsl:text>{</xsl:text></xsl:with-param> <xsl:with-param name="replacement"><xsl:text>{{</xsl:text></xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced"><xsl:text>}</xsl:text></xsl:with-param> <xsl:with-param name="replacement"><xsl:text>}}</xsl:text></xsl:with-param> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:template>
In its face-to-face meetings during 2008-01-21 through 2008-01-23 (minutes found in member-only email at http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2008Feb/0006.html), the XML Query WG made the decision to correct this error with an entry in the next version of the XQueryX Errata document. That correction is that shown in comment #1 of this bug. We are marking this bug RESOLVED and FIXED. If you are satisfied with this resolution, please mark it CLOSED. If you are not, please add another comment to this bug explaining your reasons.