How would one go about inserting an attribute at a specific position (i.e., somewhere other than at the front of the attribute list)? I would expect the following expression would do the trick: “insert node attribute aname {'avalue'} as last into //XYZ” but it still inserts the attribute at the front of the attribute list.

 

By looking at the code in the InsertAttribute update primitive, I can see that it’s hardcoded to insert at the front of the attribute list. Does this mean that there is no way to control attribute insertion location? Does the XQuery Update standard not allow such an update or is this a bug/oversight on the part of BaseX?

 

Thanks!

 

Dave