Richard,

This gets back to basic XQuery syntax. Any XQuery program (aka main module) is a sequence of expressions. In order to call two functions, we write a program than consists of a sequence of two function call expressions.

You already have two function calls, but they aren't in a sequence. At http://www.w3.org/TR/xquery/#prod-xquery-Expr we find:

        Expr       ::=          ExprSingle ("," ExprSingle)*

For example:

current-date(),
current-time()

This sequence-oriented processing model is one of the difficult parts of XQuery for most programmers to learn. Parenthetically, I'm the sort of person who taught myself Perl, Java, etc. But I found that XQuery was a difficult language to pick up on my own. I thought I could read it pretty quickly, but I was usually wrong about what the program would do, and I couldn't write new queries from scratch.

I think our three-day developer course helps with this: http://marklogic.com/services/training.html

thanks,
-- Mike

On 2009-07-20 10:53, Richard Strauch wrote:
Hi,
I’m having a problem inserting multiple documents from XQuery.  My code is like 
this

(: code to build $content1 and $content2 :)
xdmp:document-insert($uri1, $content1)
xdmp:document-insert($uri2, $content2)


either of these inserts works on its own, but when together I get the error

XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected 
QName_, expecting $end
in /insertdocs.xqy, on line 55 [0.9-ml]

Line 55 is the second document-insert.
Clearly I’m not grasping how document-insert works, is there a way to do this?

Thanks
Richard.






_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to