cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomasz Piechowicz <>
Subject Passing DOM document to xquery.
Date Tue, 04 Aug 2009 06:33:22 GMT
I would like to pass xml DOM document created in CForm to xquery. Is it
possible to access document nodes from xquery ?

My CForm generates simple xml document :

In flowscript I passed the document object to sitemap :

function editproject()
    var form = new
    var bindUri = cocoon.parameters.bindingURI;
    var docUri = cocoon.parameters.documentURI;
    var document = loadDocument(docUri);
    cocoon.sendPage("update31", {"doc" : document});

In sitemap I passed document to XqueryGenerator :

    <map:match pattern="update31">
        <map:generate src="xupdate.xq" type="xquery">
            <map:parameter name="doc" value="{flow-attribute:doc}"/>
        <map:serialize type="html"/>

And then I tried to access document structure in xquery :

xquery version "1.0";

declare namespace request="";
declare variable $doc external;

update insert

into doc("/db/tomek/projects/projects.xml")/projects

Unfortunately I recived XMLDBException that I can`t use xs:string(1 t d p)
as node collection.

Any ideas would be appreciated.

Tomek Piechowicz

View raw message