Bugs item #1896776, was opened at 2008-02-19 10:16
Message generated for change (Comment added) made by stmane
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1896776&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: XML
Group: (zombie: Pathfinder 0.20)
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Thomas Vervest (tvervest)
Assigned to: Ying Zhang (yingying)
Summary: XQ: error FORG0005 when updating xml file
Initial Comment:
When I call the function save-export (see below) via XRPC I get the following
error: "!ERROR: err:FORG0005: function fn:exactly-one expects exactly one
value."
This is the function i am calling:
------------------------------
declare updating function epv:save-export($title as xs:string
,$query as node()*)
{
let $seq := <sequence name="$title"></sequence>
return do insert $seq as last into doc("saved_exports.xml")/doc/saves
};
------------------------------
I've included the XRPC request I'm sending and the file which will be updated.
----------------------------------------------------------------------
>Comment By: Stefan Manegold (stmane)
Date: 2008-02-19 12:24
Message:
Logged In: YES
user_id=572415
Originator: NO
Thomas,
no problem.
I'll close it, then.
Stefan
----------------------------------------------------------------------
Comment By: Thomas Vervest (tvervest)
Date: 2008-02-19 12:20
Message:
Logged In: YES
user_id=1949071
Originator: YES
Hey Jennie and Stefan,
Thanks for the quick resplies, I changed my query to insert data into
('doc("saved_exports.xml")/saves') and it worked!
I'm so ashamed nobody here saw that :$
Thanks for all the help and sorry for the false bug report!
Kind regards - Thomas
----------------------------------------------------------------------
Comment By: Ying Zhang (yingying)
Date: 2008-02-19 10:52
Message:
Logged In: YES
user_id=341633
Originator: NO
Sorry, changed header information by accident.
----------------------------------------------------------------------
Comment By: Ying Zhang (yingying)
Date: 2008-02-19 10:50
Message:
Logged In: YES
user_id=341633
Originator: NO
Thomas,
The target ('doc("saved_exports.xml")/doc/saves') of an insert-into
statement must be exactly one node. I took a look at you input document,
and see that the root node of your document is "saves". This is why you
get the error: you documet doesn't have a root node "doc", so the
expression 'doc("saved_exports.xml")/doc/saves' returns an empty result,
while exactly one node is expected. So please change your query into:
doc("saved_export.xml")/saves , and see if it will work.
If you then still get the same error, you can change you query into this:
exactly-one(doc("saved_export.xml")/saves)
This is because the return type of an XPath expression (e.g.
doc("saved_export.xml")/saves) is node()*, while insert-into expect a
target node of the type node().
Due to the limitation in the typing system, MonetDB/XQuery might no able
to detect at runtime that your expression doc("saved_export.xml")/saves
actually only returns one node.
Please let us know if this helps.
Regards,
Jennie
----------------------------------------------------------------------
Comment By: Ying Zhang (yingying)
Date: 2008-02-19 10:49
Message:
Logged In: YES
user_id=341633
Originator: NO
Thomas,
The target ('doc("saved_exports.xml")/doc/saves') of an insert-into
statement must be exactly one node. I took a look at you input document,
and see that the root node of your document is "saves". This is why you
get the error: you documet doesn't have a root node "doc", so the
expression 'doc("saved_exports.xml")/doc/saves' returns an empty result,
while exactly one node is expected. So please change your query into:
doc("saved_export.xml")/saves , and see if it will work.
If you then still get the same error, you can change you query into this:
exactly-one(doc("saved_export.xml")/saves)
This is because the return type of an XPath expression (e.g.
doc("saved_export.xml")/saves) is node()*, while insert-into expect a
target node of the type node().
Due to the limitation in the typing system, MonetDB/XQuery might no able
to detect at runtime that your expression doc("saved_export.xml")/saves
actually only returns one node.
Please let us know if this helps.
Regards,
Jennie
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2008-02-19 10:30
Message:
Logged In: YES
user_id=572415
Originator: NO
Thomas,
since we just finished the new MonetDB4 4.22 / MonetDB/XQuery 0.22
release,
there will most probably be no more bug fixes for the MonetDB4 4.20 /
MonetDB/XQuery 0.20 release.
Hence, could you please check, whether how your query works with the new
MonetDB4 4.22 / MonetDB/XQuery 0.22 release?
Please see http://monetdb.cwi.nl/Development/Releases/Version4.22/ for
details.
Stefan
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1896776&group_id=56967
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs