This must be a bug. Just because one address element belongs to a certain
namespace it does not mean that all children of <addresses> have to belong
to the same namespace.

I can understand if the schema or DTD description of <addresses> prohibits
inserting address elements from different namespaces. Then the modification
should be rolled back with an error message.

Regards
tobe

> -----Ursprungligt meddelande-----
> Från: Jeroen Breedveld [mailto:[EMAIL PROTECTED]
> Skickat: den 11 januari 2002 14:55
> Till: [EMAIL PROTECTED]
> Ämne: Is this a bug?
> 
> 
> Hi, 
> 
> I'm implementing Lexus on our database and have extended the standard
> junit-testsuite with some tests from myself.
> When I perform the XUpdate query below on the standard input document
> the namespace declaration seems to move to parent of the inserted
> element, is this correct? I any case, it isn't what I expected.
> 
> greetings,
> 
> Jeroen 
> 
> input:
> 
> <?xml version="1.0"?>
> <addresses>
>   <address name="Andreas">
>     <town>New York</town>
>   </address>
>   <address name="Lars">
>     <town>Los Angeles</town>
>   </address>
> </addresses>
> 
> query:
> 
> <lexus:modifications version="1.0"
> xmlns:lexus="http://www.xmldb.org/xupdate";>
>   <lexus:insert-after select="/addresses/address[position()=2]">
>     <address:address xmlns:address="http://www.x-hive.com/address";
> name="Jeroen">
>       <address:town>Rotterdam</address:town>
>     </address:address>
>   </lexus:insert-after>
> </lexus:modifications>
> 
> result: (the first parst is what I expected the second is the result
> from Lexus)
> 
> <addresses>
>   <address name="Andreas">
>     <town>New York</town>
>   </address>
>   <address name="Lars">
>     <town>Los Angeles</town>
>   </address>
>   <address:address xmlns:address="http://www.x-hive.com/address";
> name="Jeroen">
>     <address:town>Rotterdam</address:town>
>   </address:address>
> </addresses>[1] <==> 
> <addresses xmlns:address="http://www.x-hive.com/address";>
>   <address name="Andreas">
>     <town>New York</town>
>   </address>
>   <address name="Lars">
>     <town>Los Angeles</town>
>   </address>
>   <address:address name="Jeroen">
>     <address:town>Rotterdam</address:town>
>   </address:address>
> </addresses>[1]
> E
> Time: 4,306
> There was 1 error:
> 1) testInsertAfterNS(org.infozone.lexus.testsuite.InsertAfterNSTest)
> java.lang.Exception: different attribute counts...
>       at
> org.infozone.lexus.testsuite.CompareDocuments.compare(C:/xhive
> 1.2/src/xu
> pdate/unittests/org/infozone/lexus/testsuite/CompareDocuments.java:73)
>       at
> org.infozone.lexus.testsuite.CompareDocuments.compare(C:/xhive
> 1.2/src/xu
> pdate/unittests/org/infozone/lexus/testsuite/CompareDocuments.java:29)
>       at
> org.infozone.lexus.testsuite.CompareDocuments.compare(C:/xhive
> 1.2/src/xu
> pdate/unittests/org/infozone/lexus/testsuite/CompareDocuments.java:24)
>       at
> org.infozone.lexus.testsuite.LexusTestCase.mainTest(C:/xhive1.
> 2/src/xupd
> ate/unittests/org/infozone/lexus/testsuite/LexusTestCase.java:103)
>       at
> org.infozone.lexus.testsuite.InsertAfterNSTest.testInsertAfter
> NS(C:/xhiv
> e1.2/src/xupdate/unittests/org/infozone/lexus/testsuite/Insert
> AfterNSTes
> t.java:28)
> ----------------------------------------------------------------------
> Post a message:         mailto:[EMAIL PROTECTED]
> Unsubscribe:            
> mailto:[EMAIL PROTECTED]
> Contact administrator:  mailto:[EMAIL PROTECTED]
> Read archived messages: http://archive.xmldb.org/
> ----------------------------------------------------------------------
> 
----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to