Re: [bdbxml] How update metadata with XmlModify
John Snelson <[email protected]> Tue, 23 Aug 2005 16:34:41 +0100
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Marcin,
You cannot modify meta data using XmlModify, only document content. You
should use the XmlDocument::setMetaData() method to modify a document's
metadata.
If you want to perform this modification at the same time as a
modification of the document content, you can do this in one of two ways:
1) Modify the metadata first, the use XmlModify to modify the content.
2) Set XmlUpdateContext::setApplyChangesToContainers() to false, use
XmlModify to change the content, XmlDocument::setMetaData() to change
the meta data, and then manually call XmlContainer::updateDocument()
with the modified XmlDocument.
I hope this helps,
John
Marcin Kuthan wrote:
> Hi All
>
> My application modifies some part of document with XmlModify.
>
> Fragment of application code:
>
> //
> XmlQueryExpression expr1 = manager.prepare("query1", qContext);
> XmlQueryExpression expr2 = manager.prepare("query2", qContext);
>
> xmlModify.addAppendStep(expr1, XmlModify.Element, "new1", content1);
> xmlModify.addAppendStep(expr2, XmlModify.Element, "new2", content2);
>
> XmlDocument document = container.getDocument(documentId);
> XmlValue value = new XmlValue(document);
>
> xmlModify.execute(value, qContext, uContext);
> //
>
> How should I update metadata with modified document?
>
> 1. Add updateStep to xmlModify. But how to design selection query for
> metadata attribute?
> 2. Call setMetaData on document. But after or before execute of
> xmlModify, and when call updateDocument on xmlContainer?
>
>
> Any help would be appreciated.
>
>
>
> ------------------------------------------
> To remove yourself from this list, send an
> email to [email protected]
>
--
John Snelson, Berkeley DB XML Engineer
Sleepycat Software, Inc
http://www.sleepycat.com
Contracted to Sleepycat through Parthenon Computing Ltd
http://blog.parthcomp.com/dbxml
------------------------------------------
To remove yourself from this list, send an
email to [email protected]