[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problems using ozone as a xml repository



Hi, 

Mamei Marco wrote:
>  I tryed to implement the previous idea, but I had some problems:
>  I stored in the db a document like this one:
>  
>  <xml version="1.0">
>  <repository>
>  </repositiry>
>  
>  then I tryed to add other docs by Xupdate command. I used the following
>  Xupdate query:
>  
>  <lexus:modifications version="1.0"
>  xmlns:lexus="http://www.xmldb.org/xupdate">
>          <lexus:append select="/xmlrepository" child="last()">
>                  <lexus:element name="article">
>                                  .........
>                  </lexus:element>
>          </lexus:append>
>  </lexus:modifications>
>  
>  Now the first time it works, then it overwrites the previously written
>  article.
>  What is wrong with this Xupdate?

Your XUpdate-example is correct. It appends one <article/> element to the end of
the <xmlrepository> element. If there are already children of the
<xmlrepository> element, the <article> element will be append after these
children. 

In the current available CVS version still another older version of XUpdate is
used. I tested the following with the new version, that should be now
available.

<lexus:modifications version="1.0"
        xmlns:lexus="http://www.xmldb.org/xupdate">
        <lexus:append select="/xmlrepository" child="last()">
                <lexus:element name="article">
                </lexus:element>
                <lexus:element name="article">
                </lexus:element>
        </lexus:append>
</lexus:modifications>

Also it should be able to write the following:

<lexus:modifications version="1.0"
        xmlns:lexus="http://www.xmldb.org/xupdate">
        <lexus:append select="/xmlrepository" child="last()">
                <lexus:element name="article">
                </lexus:element>
        </lexus:append>
        <lexus:append select="/xmlrepository" child="last()">
                <lexus:element name="article">
                </lexus:element>
        </lexus:append>
</lexus:modifications>

Both elements are appended as last child. I also tested the following
situation. I used the following document:

<xmlrepository>
	<article date="yesterday"/>
</xmlrepository>

I used your XUpdate and the result was:

<xmlrepository>
	<article date="yesterday"/>
	<article/>
</xmlrepository>


Best Regards
Andreas

-- 
_____________________________________________________
Andreas Laux               mailto:andreas@smb-tec.com
SMB GmbH                       http://www.smb-tec.com