This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9290 - wrong XQueryX tests - difference in dealing with newlines
Summary: wrong XQueryX tests - difference in dealing with newlines
Status: RESOLVED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.2
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://zorba-xquery.com
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-22 15:36 UTC by Daniel Turcanu
Modified: 2010-06-15 13:18 UTC (History)
1 user (show)

See Also:


Attachments

Description Daniel Turcanu 2010-03-22 15:36:34 UTC
Some XQueryX tests have the results differ from the XQuery correspondend, because of different processing of new line. 
In XQueryX test, the XSL transformation changes the newline to 
 and this makes the result to not match the expected one.

The failing tests are:
XQueryX/Expressions/Construct/DirectConElem/DirectConElemAttr/Constr-attr-ws-1
XQueryX/Expressions/Construct/DirectConElem/DirectConElemAttr/Constr-attr-ws-2

Testing was performed with Zorba XQuery 1.1 .
Comment 1 Andrew Eisenberg 2010-04-05 16:19:44 UTC
Daniel, I've looked at test case Constr-attr-ws-1 and I do not see a problem.

The xquery for this test case is:

<elem attr="
"/>

I see OD and 0A characters for the content of the attribute. The expected result is:

<elem attr=" "/>

This attribute contains just a space character.

The XQueryX that has been generated for this test case includes:

          <xqx:attributeConstructor>
            <xqx:attributeName>attr</xqx:attributeName>
            <xqx:attributeValue> </xqx:attributeValue>
          </xqx:attributeConstructor>

xqx:attributeValue contains a space character. Evaluating this XQueryX should produce the expected result.


Perhaps I have misunderstood you in some way.
Comment 2 Andrew Eisenberg 2010-05-03 22:03:48 UTC
Daniel, if I don't receive any further information from you, then I will have to close this bug report without making any changes.
Comment 3 Daniel Turcanu 2010-05-07 15:22:42 UTC
AFAIK In xml the whitespaces between tags are ignored, if there are only whitespaces.
So the space inside <xqx:attributeValue> </xqx:attributeValue> gets ignored, and xslt transforms it into <elem attr=""/>.
This is with the latest XQTS.
Comment 4 Andrew Eisenberg 2010-05-10 20:05:29 UTC
I believe that the space in xqx:attributeValue must be retained. Section 2, Mapping the XQuery Syntax, of XQueryX says:

"The XQueryX semantics are defined by a stylesheet that maps an instance of XQueryX to an instance of XQuery; see B Transforming XQueryX to XQuery."
 
The following declarations appear at the beginning of xqueryx.xsl:

  <xsl:output method="text"/>
  <xsl:strip-space elements="*"/>
  <xsl:preserve-space elements="xqx:value xqx:attributeValue xqx:pragmaContents
                                xqx:optionContents xqx:xquery"/>


Section 4.4, Stripping Whitespace from a Source Tree, of XSLT 2.0 says:

"The set of whitespace-preserving element names is specified by xsl:strip-space and xsl:preserve-space  declarations. Whether an element name is included in the set of whitespace-preserving names is determined by the best match among all the xsl:strip-space or xsl:preserve-space declarations: it is included if and only if there is no match or the best match is an xsl:preserve-space element."
Comment 5 Andrew Eisenberg 2010-06-07 16:48:48 UTC
Once again, Daniel, if I don't receive any further information from you, then I will have to close this bug report without making any changes.