Project

Profile

Help

Bug #2365

closed

Unexpected result when executing an XQuery update

Added by Radu Pisoi over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XQuery Update
Sprint/Milestone:
Start date:
2015-04-28
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

I think that the result of the next XQuery Update transformation is wrong.

test.xq


xquery version "3.0";

declare variable $toInsert as node()+ := 
  <container>TO-INSERT<to-insert/></container>;

insert nodes $toInsert//node()
  as first into doc('insert.xml')//a

insert.xml

<?xml version="1.0" encoding="UTF-8"?>
<a>text</a>

I suppose the correct result should be:

<a>TO-INSERT<to-insert/>text</a> 

but is:

<?xml version="1.0" encoding="UTF-8"?>
<a>TO-INSERTtext<to-insert/>
</a>

However, if the input XML document is:

<?xml version="1.0" encoding="UTF-8"?>
<a><child>text</child></a>

then the result is the expected one:


<?xml version="1.0" encoding="UTF-8"?>
<a>TO-INSERT<to-insert/><child>text</child></a>

Please register to edit this issue

Also available in: Atom PDF