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 28537 - [FO30] [FO31] Examples on fn:element-with-id uses fn:id and is not aligned with accompanying text
Summary: [FO30] [FO31] Examples on fn:element-with-id uses fn:id and is not aligned wi...
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 minor
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2015-04-22 16:41 UTC by Abel Braaksma
Modified: 2015-05-06 01:21 UTC (History)
1 user (show)

See Also:


Description Abel Braaksma 2015-04-22 16:41:38 UTC
Under Examples, under 14.7.2 fn:element-with-id (FO30) and 14.5.2 fn:element-with-id (FO31) the text presently reads (numbering mine):

1) The expression id('ID21256')/name() returns "employee". (The xml:id 
   attribute has the is-id property, so the employee element is selected.).

2) The expression id('E21256')/name() returns "employee". (Assuming the
   empnr element is given the type xs:ID as a result of schema validation, 
   the element will have the is-id property and is therefore its parent is 
   selected. Note the difference from the behavior of fn:id.).

Text of (1) is technically correct, but the section is about fn:element-with-id, not about fn:id. Replacing id('ID21256')/name() with element-with-id('ID21256')/name() seems to make more sense.

Text of (2) is technically wrong, as id(...) returns the element with is-id property, not its parent. Replacing id(...) with element-with-id(...) fixes this.

And a suggestion: I noticed that fn:idref does not have any example. Not a big deal, but the indirection of this function, and the same question as with fn:id vs fn:element-with-id (i.e., does it select its parent or the attribute/element with is-idref property) seems to warrant one ;).

PS: I filed this bug under FO30, but it applies equally to FO31 as well.
Comment 1 Michael Kay 2015-04-22 22:34:06 UTC
Reclassified as FO31 to ensure it gets on the agenda.
Comment 2 Michael Kay 2015-05-05 17:42:43 UTC
The changes were accepted and have been applied.
Comment 3 Abel Braaksma 2015-05-06 01:21:14 UTC
Thanks, I'll close the bug.