Problem with oxf:xmldb-delete

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with oxf:xmldb-delete



Though I specify the collection collection="/db/TBAHtest">
And my query looks like:

<xdb:delete xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:pcs="http://www.asml.com/XMLSchema/Generic/Generic/ADELpcs/v1.0" xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xforms="http://www.w3.org/2002/xforms" collection="/db/PCS/alpha">/pcs:PCS[@documentname = '42A00B8B-7024-1B0A-A168-38DACFB3B3C0']</xdb:delete>

Deletion of the documents from the root /db works fine.

Any Ideas what am I doing wrong?

Thanks in advance.

Taras


-- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Taras Bahnyuk

I need to update an existing document in the db.
For that I want delete the current instance of the document and then insert an updated document with the same document name back into the db.

I use the code from the bizdoc example:

<!-- Delete existing document by documentname Dynamically build query -->

<p:processor name="oxf:xslt">
<p:input name="data" href="#updated-instance#xpointer(/form/document-id)"/>
<p:input
name="config">
    <xdb:delete xsl:version="2.0" collection="/db/TBAHtest">
    <xsl:text>/pcs:PCS[@documentname = '</xsl:text>
    <xsl:value-of select="."/>
    <xsl:text>']</xsl:text>
    </xdb:delete>
</p:input>
<p:output name="data" id="query"/>
</p:processor>

<!-- Run query -->
<p:processor name="oxf:xmldb-delete">
   
<p:input name="datasource" href="datasource.xml"/>
    <p:input name="query" href="#query"></p:input>
</p:processor>


It does not seem to be able to delete anything from any other collection but the root.
And gives me the errormessage:
    org.exist.EXistException: Document /db/6ec2f226.xml not found

Reply | Threaded
Open this post in threaded view
|

Re: Problem with oxf:xmldb-delete

Erik Bruchez
Administrator
Taras,

Hard to tell like this, especially since we now tend to prefer using the
eXist REST API (either directly from XForms or from the
oxf:xforms-submission processor). Do you have the Orbeon source code,
and if so can you use a Java debugger on the oxf:xmldb-delete processor
to try to see if there is a bug in the way the collection is passed?

-Erik

Taras Bahnyuk wrote:

> I need to update an existing document in the db.
> For that I want delete the current instance of the document and then
> insert an updated document with the same document name back into the db.
>
> I use the code from the bizdoc example:
>
> <!-- Delete existing document by documentname Dynamically build query -->
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#updated-instance#xpointer(/form/document-id)"/>
> <p:input name="config">
>     <xdb:delete xsl:version="2.0" collection="/db/TBAHtest">
>     <xsl:text>/pcs:PCS[@documentname = '</xsl:text>
>     <xsl:value-of select="."/>
>     <xsl:text>']</xsl:text>
>     </xdb:delete>
> </p:input>
> <p:output name="data" id="query"/>
> </p:processor>
>
> <!-- Run query -->
> <p:processor name="oxf:xmldb-delete">
>     <p:input name="datasource" href="datasource.xml"/>
>     <p:input name="query" href="#query"></p:input>
> </p:processor>
>
>
> It does not seem to be able to delete anything from any other collection
> but the root.
> And gives me the errormessage:
>     org.exist.EXistException: Document /db/6ec2f226.xml not found
>
> Though I specify the collection collection="/db/TBAHtest">
> And my query looks like:
>
> <xdb:delete xmlns:oxf="http://www.orbeon.com/oxf/processors"
> xmlns:pcs="http://www.asml.com/XMLSchema/Generic/Generic/ADELpcs/v1.0"
> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb"
> xmlns:p="http://www.orbeon.com/oxf/pipeline"
> xmlns:xforms="http://www.w3.org/2002/xforms"
> collection="/db/PCS/alpha">/pcs:PCS[@documentname =
> '42A00B8B-7024-1B0A-A168-38DACFB3B3C0']</xdb:delete>
>
> Deletion of the documents from the root /db works fine.
>
> Any Ideas what am I doing wrong?
>
> Thanks in advance.
>
> Taras
--
Orbeon Forms - XForms Everywhere
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws