[bdbxml] How retrieve metadata onto a document?

Ambar Mendez <[email protected]> Tue, 6 Sep 2005 04:28:18 +0000 (UTC)
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Hi all ...

My application set metadata by:

String URI = "http://dbxmlExamples/metadata";
byte[] img = {1,2,3,4,5,6,7,8};
String attrName = "byteArray";			
XmlUpdateContext contextManagement = myManager.createUpdateContext();
XmlDocument myDoc = myManager.createDocument();
myDoc.setName("doc");
myDoc.setContent("<example>doc</example>");
myDoc.setMetaData(URI,attrName,img);
myContainer.putDocument(myDoc,contextManagement,0);

And retrieve by:

XmlQueryContext context = myManager.createQueryContext();		
context.setNamespace("mn","http://dbxmlExamples/metadata");
			
String query = "collection('exmples.bdbxml')/example";
XmlQueryExpression qe = myManager.prepare(query,context);
XmlResults results = myManager.query(query,context);
XmlValue value = results.next();
  if(value != null){
    XmlDocument theDoc = value.asDocument();
    String docName = theDoc.getName();
    byte[] byteArray= null;
    theDoc.getMetaData("http://dbxmlExamples/metadata","byteArray",byteArray));
  }

But byteArray continue null. Also, test with:
1. String query = "collection('images.bdbxml')/@dbxml:byteArray";
2. XmlMetaDataIterator

I don't know, what's wrong?

Any help would be appreciated.



------------------------------------------
To remove yourself from this list, send an
email to [email protected]