[Bug 3446] [XQueryX] constructing attribute values with whitespace characters

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3446

           Summary: [XQueryX] constructing attribute values with whitespace
                    characters
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQueryX
        AssignedTo: jim.melton@acm.org
        ReportedBy: andrew.eisenberg@us.ibm.com
         QAContact: public-qt-comments@w3.org


I might want to construct an XQueryX instance that is equivalent to the
following XQuery:

<elem attr="a&#x09;b"></elem>

I can try to do this with the following:

<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>elem</xqx:tagName>
        <xqx:attributeList>
          <xqx:attributeConstructor>
            <xqx:attributeName>attr</xqx:attributeName>
            <xqx:attributeValue>a&#x09;b</xqx:attributeValue>
          </xqx:attributeConstructor>
        </xqx:attributeList>
      </xqx:elementConstructor>
    </xqx:queryBody>
  </xqx:mainModule>
</xqx:module>

The XQueryX stylesheet turns this into the following:

<elem attr="a   b"></elem>

This XQuery will not produce the same result as the XQuery that I desire.

When I use "a&amp;#x09;b" for the attribute value, then the stylesheet produces
the following:

<elem attr="a&amp;#x09;b"></elem>

Again, not what I desire.

This issue applies to all of the whitespace characters, #x09;, #x0a;, and
#x0d;.

Do we need additional markup in order to preserve char refs such as these?
Something like the following:

<xqx:attributeValue>a<xqx:charRefHex>09</xqx:charRefHex>b</xqx:attributeValue>

Received on Tuesday, 11 July 2006 15:02:39 UTC