logo       

XUpdate - generating duplicate attributes: msg#00169

text.xml.exist

Subject: XUpdate - generating duplicate attributes

Hi,

I have a found a bug IMHO.

Then I perform the XUpdate query provided below - I got 2 strange things:

1) both xu:if statements are evaluated true (!)
2) resulted document has one more (!) attribute usageCount each time I perform the operation. So 10 executions => 10 attributes usageCount - I thought that there "can only be one" attribute with each name?

Thanks

Sebastian


<xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate"; >

<xu:if test="not(document('/db/elvis/doc/1234567.xml')/Book[@usageCount])">
<xu:append select="document('/db/elvis/doc/1234567.xml')/Book">
<xu:attribute name="usageCount">0</xu:attribute>
</xu:append>
</xu:if>

<xu:if test="document('/db/elvis/doc/1234567.xml')/Book[@usageCount]">
<xu:update select="document('/db/elvis/doc/1234567.xml')/Book/@usageCount">'{'util:eval(concat(document('/db/elvis/doc/1234567.xml')/Book/@usageCount,"+1"))'}'</xu:update>
</xu:if>

</xu:modifications>

--
-----------------------------------------
-- Sebastian Ryszard Kruk, M.Sc.
-- mailto: skruk@xxxxxxx
-- GG: 335067, Jabber: s_kruk@xxxxxxxxx
-----------------------------------------


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise