My XPL needs to return information that can then be used by the page flow for dynamic navigation. My problem is that I cannot get any output from my XPL.
The following XPL executes and creates the collection needed. But, if I put in a <p:output>, the XPL does not execute at all or give me any traceback that indicates what the issue is. <p:processor name="oxf:xmldb-query"> <p:input name="datasource" href="../services/datasource.xml"/> <p:input name="query"> <xdb:query collection="/db/orbeon/m" create-collection="true"> xquery version "1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; <parameters> { let $a := '2' let $b := concat('/db/orbeon/m/',$a) let $name := 'ingest' let $status := xmldb:create-collection($b,$name) return <dbpath>{$a}</dbpath> } </parameters> </xdb:query> </p:input> </p:processor> I even tried the exact example provided at http://www.orbeon.com/ops/doc/processors-xmldb (2.2.1) and when the p:output is declared, the file is not created. But when the output is removed, everything works as expected. Any idea of what may be causing the problem? Is there a better way to dynamically create a collection and have the resulting page be the view within that collection? |
Administrator
|
My preference would be to use the submission processor to send your XQuery to eXist instead of the XML:DB processors. Then you can have an output to the processor which you can connect to the output of your pipeline.
Alex
|
I now use the submission processor. The output is being returned to the processor, but the dynamic page flow is not working for me. If anyone can notice what I am doing wrong or missing, please let me know. The "ingest" page does display, but not in the proper context I need it too (which is provided via the dbpath). When examining the parameters-instance in the page, the value I need in the dbpath is in fact there and correct. My problem is the pageflow is not using it as values in the URL as I need it to.
<page id="create" path-info="/m/([^.]*)/ingestFolder" matcher="oxf:perl5-matcher"> <action action="addIngestFolder.xpl"> <result page="ingest" transform="oxf:xslt"> <parameters xsl:version="2.0" xmlns:xsl="http://w3.org/1999/XSL/Transfrom"> <dbpath><xsl:copy-of select="doc('input:action')/dbpath"/></dbpath> </parameters> </result> </action> </page> <page id="ingest" path-info="/m/([^.]*]/ingestContents" matcher="oxf:perl5-matcher" default-submission="contents/parameters.xml" view="ingest-contents.xhtml"> <setvalue ref="/parameters/dbpath" matcher-group="1"/> </page> And thanks for the advice Alex, I like using the submission processor a lot!
|
Administrator
|
Alex,
First, on your parameters, try to add xmlns="" (<parameters xmlns="">). Otherwise the XML you get in the ingest will contain a <parameters> element but it will be in the page flow namespace (which is the default namespace in your page-flow.xml). Let's see if the problem is as simple as that :). Alex |
Administrator
|
Alex,
This being said, instead of doing this in the page flow, could you do this in XForms, in the "create" page? I.e. run the submission that you now run in addIngestFolder.xpl, and submit the resulting instance to the "ingest" page using another <xforms:submission replace="all">? (This would be by far my preference: using XForms whenever it is possible, instead of relying on more complicated logic in the page flow.) Alex |
Free forum by Nabble | Edit this page |