- From: Mary Fernandez <mff@research.att.com>
- Date: 08 Jan 2003 10:07:06 -0500
- To: Michael Kay <Michael.Kay@softwareag.com>
- Cc: Howard Katz <howardk@fatdog.com>, www-ql@w3.org
On Wed, 2003-01-08 at 08:33, Kay, Michael wrote: > > > In the *path* expression: > > > > (salary, bonus)[. > 0] > > > > the resulting salary and bonus elements whose content is > > greater than zero will be in document order. This is because > > path expressions always yield sequences of nodes in document > > order whereas sequence expressions yield sequences of nodes > > in input order. > > No, I don't think this is correct. [] does not cause the sequence it applies > to to be reordered. The language book has a problem in this area, which I > will raise on the TF list, but the formal semantics is correct, I believe. My mistake. You're absolutely right -- the formal semantics has it right. Document order is only enforced when a '/' or step occurs in the expression. So here are the corrected examples: (salary, bonus)[ . > 0 ] the resulting salary and bonus elements whose content is greater than zero will be in input order. (salary, bonus)/self::node()[ . > 0 ] the resulting salary and bonus elements whose content is greater than zero will be in document order, because the step expression /self::node() yields nodes in document order. (salary, 3, bonus)[. > 0] the resulting nodes and atomic values whose content/value is greater than zero will be in input order. (salary, 3, bonus)/self::node()[. > 0] will raise an error, because the atomic value '3' is not a node. I hope my ducks are in a row now. thx Mary -- Mary Fernandez, Principal Technical Staff Member AT&T Labs - Research, 180 Park Ave., Room E243, Florham Park, NJ 07932-0971 phone: 973-360-8679, fax: 973-360-8187 mff@research.att.com, http://www.research.att.com/~mff
Received on Wednesday, 8 January 2003 10:07:23 UTC