sidewinderlabs / backplanejs

Other
12 stars 3 forks source link

insert does not evaluate @at="last()" correctly #98

Closed backplane-import closed 13 years ago

backplane-import commented 13 years ago

Imported from backplanejs Google Code issue 98.

Reporter fdintino
Date 16 Aug 2010 12:17:00 AM UTC

See XForms 1.1 spec 10.3.4 at http://www.w3.org/TR/xforms11/#action-insert :

... [I]f the at attribute is not given, then the insert location node is the last node of the Node Set Binding node-set. Otherwise, an insert location node is determined from the at attribute as follows:

The evaluation context node is the first node in document order from the Node Set Binding node-set, the context size is the size of the Node Set Binding node-set, and the context position is 1. ...

Consider the following model:

xf:model

1 2 4 3 /xf:instance /xf:model Expected output: There should be four nodes under /data/list, with values 1, 2, 3, 4 (in that order) Current output: Four nodes under /data/list with values 3, 1, 2, 4 (in that order) This is because the context is not having the size and position set, so last() is not evaluating correctly. --- **Priority**: Medium **Type**: Defect
backplane-import commented 13 years ago

Comment by fdintino on 16 Aug 2010 12:55:55 AM UTC

Patch branch is at http://code.google.com/r/fdintino-backplanejs/source/list?r=a9f2cef356497ced8917945c3cff6808b1221f3b

Patch attached.


Attachments

ft-insert-at-expr.patch (5.1 KB)

backplane-import commented 13 years ago

Comment by fdintino on 16 Aug 2010 1:06:29 AM UTC

Woops, submitted this logged in under a different account.

Patch branch for fix is at http://code.google.com/r/fdintino-backplanejs/source/list?r=be2bd67cdacfb1f78bf5f75468d15d31a4079207

Patch for fix is attached


Updates

Owner set to fdintino

Ticket status set to FixPending


Attachments

issue-98-insert-at-expr.patch (963 bytes)

backplane-import commented 13 years ago

Comment by fdintino on 16 Aug 2010 1:07:44 AM UTC

Modification to fix:

There should be a "var" preceding the first atContext

backplane-import commented 13 years ago

Comment by fdintino on 31 Aug 2010 1:03:00 PM UTC

This issue was closed by revision 7ef0d70787edbe2f46cd82422c8b15dc1f3c702a (originally 3c67ed04d9).


Updates

Ticket status set to Fixed