[Bug 5334] [UPD] Inserting attributes

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

           Summary: [UPD] Inserting attributes
           Product: XPath / XQuery / XSLFO / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Update Facility
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


The rules on insertion of attributes seem highly arbitrary.

You are allowed to say

insert node @a after $x/*[12]

and it happily adds a copy of @a to $x, ignoring the requested position.

You can also say

insert nodes (@a, <e/>) after $x/*[12]

and it happily inserts @a as an attribute of $x, and adds <e/> as its 13th
child element.

But you can't say

insert nodes (<e/>, @a) after $x/*[12]

because the source expression isn't allowed to have an attribute appearing
after a non-attribute.

This seems very inconsistent. I would suggest either relaxing the rules by
eliminating error XUTY0004, or making the rules stricter by disallowing all use
of positional qualifiers (after, before, as first, as last) when the source
expression contains an attribute.

Received on Tuesday, 1 January 2008 22:15:12 UTC