Quantcast

Xupdate:append problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Xupdate:append problem

Peter Klotz-2
Hi,

I'm executing a XUpdate query against a pretty new cvs-build eXist build
using the ant task (but this should be not different from CLI and other
means).

I have e.g. the following document

<?xml version="1.0" encoding="UTF-8"?>
<pkg:packages xmlns:pkg="http://blue-elephant-systems.com/midas/tasks/1.0">
    <pkg:package id="ovopkg_616C6C5F62616C7472756D_07092005174428647" name="all_baltrum" platform="unix" type="ovo"/>
</pkg:packages>

and want to insert another pkg:package tag after the current one and
obviously one should use a append modification like this:


<?xml version="1.0"?>
<xupdate:modifications version="1.0"
  xmlns:xupdate="http://www.xmldb.org/xupdate"
  xmlns:pkg="http://blue-elephant-systems.com/midas/tasks/1.0">
  <xupdate:append select="/pkg:packages">
   <xupdate:element name="pkg:package">
     <xupdate:attribute
name="id">ovopkg_616C6C5F70756D6F7269_07092005173500289</xupdate:attribute>
     <xupdate:attribute name="name">all_pumori</xupdate:attribute>
     <xupdate:attribute name="platform">unix</xupdate:attribute>
     <xupdate:attribute name="type">ovo</xupdate:attribute>
   </xupdate:element>
  </xupdate:append>
</xupdate:modifications>

The effect is unfortunately that the existing pkg:package tag is
REPLACED instead of being APPENDed.
I also tried a insert-after but that doesn't work in case there is no
tag in pkg:packages yet.

<?xml version="1.0"?>
<xupdate:modifications version="1.0"
  xmlns:xupdate="http://www.xmldb.org/xupdate"
  xmlns:pkg="http://blue-elephant-systems.com/midas/tasks/1.0">
  <xupdate:insert-after select="/pkg:packages/pkg:package[last()]">
   <xupdate:element name="pkg:package">
     <xupdate:attribute
name="id">ovopkg_616C6C5F70756D6F7269_07092005173908824</xupdate:attribute>
     <xupdate:attribute name="name">all_pumori</xupdate:attribute>
     <xupdate:attribute name="platform">unix</xupdate:attribute>
     <xupdate:attribute name="type">ovo</xupdate:attribute>
   </xupdate:element>
  </xupdate:insert-after>
</xupdate:modifications>

Also I tries writing the tag in there as is instead of xupdate:element
but with no success:

<?xml version="1.0"?>
<xupdate:modifications version="1.0"
  xmlns:xupdate="http://www.xmldb.org/xupdate"
  xmlns:pkg="http://blue-elephant-systems.com/midas/tasks/1.0">
  <xupdate:append select="/pkg:packages">
   <pkg:package id="ovopkg_616C6C5F62616C7472756D_07092005174428647"
name="all_baltrum" platform="unix" type="ov
o"/>
  </xupdate:append>
</xupdate:modifications>


Is this a known bug, as I found e.g. entries on the mailing list from
Feb 05 which did go in a similar direction?
Any known workaround?

Peter

peter.klotz.vcf (373 bytes) Download Attachment
Loading...