Re: [bdbxml] Document modifications are not applied

George Feinberg <[email protected]>
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
I see it now.  The context item for your modification is the
document itself, so you query for the modification must
take that into consideration.
So, instead of:
     BerkManager.prepare("collection('xmachberk.dbxml')/kenndaten 
[@doc_id=d" +                    String.valueOf(intDocId) +"]/ 
felder_als_attribute/@double_feld_r", context);
You should use:
     BerkManager.prepare("./kenndaten[@doc_id=d" + String.valueOf 
(intDocId) +"]/felder_als_attribute/@double_feld_r", context);

Or something that is relative to the root of the document.

George

> Does nobody have an idea what the problem could be?
>
> Stephan
>
>
> Stephan Korthoff wrote:
>
>
>> Hello,
>>
>> I've got a problem with the modification of documents. I took the
>> modification example from sleepycat.com and
>> implemented an attribute value change as follows:
>>
>>
>>   ....             try
>> {
>>   XmlModify BerkModifier = BerkManager.createModify();
>>   XmlQueryContext context = BerkManager.createQueryContext();
>>
>>   XmlQueryExpression BerkQExp =
>> BerkManager.prepare("collection('xmachberk.dbxml')/kenndaten 
>> [@doc_id=d" +                    String.valueOf(intDocId) +
>> "]/felder_als_attribute/@double_feld_r", context);
>>
>>   System.out.println("DEBUG Anfrage:
>> collection('xmachberk.dbxml')/kenndaten[@doc_id=d"  
>> +                    String.valueOf(intDocId) +
>> "]/felder_als_attribute/@double_feld_r");
>>
>>   BerkModifier.addUpdateStep(BerkQExp, newAttributeValue );
>>    System.out.println("DEBUG retdoc: " + retDoc.getContentAsString 
>> ());
>>
>>   XmlDocument retDoc = BerkContainer.getDocument(docId);
>>
>>   XmlValue docValue = new XmlValue(retDoc);
>>              System.out.println("DEBUG docValue asString: " +  
>> docValue.asString());
>>                          BerkModifier.execute( docValue, context,  
>> BerkUpdContext);
>>              XmlDocument retDoc2 = BerkContainer.getDocument 
>> (docId); // +
>> String.valueOf(intDocId));
>>              System.out.println("DEBUG docValue ret2: " +
>> retDoc2.getContentAsString());
>>   }
>>
>> ...
>>
>>
>> The problem is that the document will not be modified. The line
>> System.out.println("DEBUG retdoc: " + retDoc.getContentAsString());
>>
>> gives me the same output as
>> System.out.println("DEBUG docValue ret2: " +  
>> retDoc2.getContentAsString());.
>>
>> And a manual check with the console utility gives me of course the  
>> same
>> result.
>>
>>
>>
>> Any help is highly appreciated.
>>
>>
>> Best regards,
>>
>>
>> Stephan Korthoff
>>
>>
>>
>
>
>
> ------------------------------------------
> To remove yourself from this list, send an
> email to [email protected]
>
>



------------------------------------------
To remove yourself from this list, send an
email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.