Re: [bdbxml] How update metadata with XmlModify
George Feinberg <[email protected]> Tue, 23 Aug 2005 10:41:34 -0400
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
On Aug 23, 2005, at 10:08 AM, 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?
You could select it, but there's really no way to update metadata using
XmlModify.
> 2. Call setMetaData on document. But after or before execute of
> xmlModify, and when call updateDocument on xmlContainer?
This is the only way you can do it.
Any time before you call updateDocument() is fine.
If you have your updatecontext set to implicitly update documents,
then you need to do this before executing XmlModify.
Would the addition of an addUpdateStep() that affects metadata do
the trick for you? That may be a reasonable feature to add.
Regards,
George
------------------------------------------
To remove yourself from this list, send an
email to [email protected]