Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 79677 invoked from network); 9 Sep 2006 14:35:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2006 14:35:01 -0000 Received: (qmail 23601 invoked by uid 500); 9 Sep 2006 14:35:01 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 23392 invoked by uid 500); 9 Sep 2006 14:35:00 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 23383 invoked by uid 99); 9 Sep 2006 14:35:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Sep 2006 07:35:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Sep 2006 07:34:59 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 79E337142F4 for ; Sat, 9 Sep 2006 14:31:23 +0000 (GMT) Message-ID: <9680094.1157812283495.JavaMail.jira@brutus> Date: Sat, 9 Sep 2006 07:31:23 -0700 (PDT) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1759) XMLSERIALIZE operator doesn't follow SQL/XML spec in some areas when serializing a sequence. In-Reply-To: <3455226.1156450610884.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1759?page=comments#action_12433602 ] Bryan Pendleton commented on DERBY-1759: ---------------------------------------- I intend to merge revision 441740 to the 10.2 branch today. The merge and build were clean. I'm running some tests just to be sure. > XMLSERIALIZE operator doesn't follow SQL/XML spec in some areas when serializing a sequence. > -------------------------------------------------------------------------------------------- > > Key: DERBY-1759 > URL: http://issues.apache.org/jira/browse/DERBY-1759 > Project: Derby > Issue Type: Bug > Affects Versions: 10.2.1.0, 10.2.2.0, 10.3.0.0 > Reporter: A B > Assigned To: A B > Fix For: 10.2.2.0, 10.3.0.0 > > Attachments: d1759_v1.patch, d1759_v1.stat > > > The SQL/XML specification dictates that, when serializing a sequence of XML items, the XMLSERIALIZE operator must first "normalize" the sequence based on the rules defined here: > http://www.w3.org/TR/xslt-xquery-serialization/#serdm > The current Derby implementation doesn't perform such normalization, which leads to two ways in which the results of an XMLSERIALIZE operator may not agree with the required behavior: > 1. Sequences of atomic values will not have spaces between, but > the space is required as part of step 3 of the normalization > rules at the above link. > 2. Derby will allow serialization of a sequence even if it has > a top-level Attribute node in it, but the rules of normalization > dictate that an error should be thrown instead (step 7). > Both of these behaviors can be seen with the following query. > values > xmlserialize( > xmlquery('/ageinfo/@*' passing by ref > xmlparse( > document '' > preserve whitespace > ) > empty on empty > ) > as char(50) > ) > Derby will currently return the following result from this statement: > 1 > -------------------------------------------------- > 481900-02-08 > This result does not abide by SQL/XML specification because a) Derby allowed serialization of a sequence having a top-level attribute node (actually, the sequence had two), and b) the atomic values produced from the attributes were displayed without a space between them. > The correct behavior for the above example is to return a serialization error caused by the presence of an Attribute node in the sequence. > If the example was rewritten as, say: > - xmlquery('/ageinfo/@*' passing by ref > + xmlquery('fn:data(/ageinfo/@*)' passing by ref > then the attribute nodes are no longer present--we only have their atomic values, which is allowed. Thus the correct result should then be: > 1 > -------------------------------------------------- > 48 1900-02-08 > Note, though, that Xalan doesn't appear to support the "fn:data" function, so this rewritten query won't actually work. I tried using Xalan's built-in string function, as follows: > - xmlquery('/ageinfo/@*' passing by ref > + xmlquery('string(/ageinfo/@*)' passing by ref > but Xalan only returns the first attribute in that case; it doesn't return the second one. So part of this Jira issue is probably going to involve figuring out how to allow a user to retrieve a sequence of attribute *values* (as opposed to attribute nodes) using Xalan and still abide by the SQL/XML rules. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira