> 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