[bdbxml] berkeley xml collection results problem
iose <[email protected]>
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi to all,
i have some problem managing collection fro db.
I have put a document into xml db of such type:
"<rubrica><contact><nome>iose</nome><cognome>magno</cognome></contact><contact>
<nome>ciccio</nome><cognome>faga</cognome></contact></rubrica>"
then i try to query the document for elements.
mgr = new XmlManager();
XmlManagerConfig mgrconfig= new XmlManagerConfig();
XmlValue var = new XmlValue("iose");
cont = mgr.openContainer("c://lavori//TestRicerca//miodatabase.dbxml");
XmlQueryContext context = mgr.createQueryContext();
context.setVariableValue("myVar", var);
String myQuery = "collection
('c://lavori//TestRicerca//miodatabase.dbxml')/rubrica/contact/nome[.=
$myVar]";
context.setReturnType(XmlQueryContext.DeadValues);
// Prepare (compile) the query
XmlQueryExpression qe = mgr.prepare(myQuery, context);
// Run the query.
results = qe.execute(context);
When i run the code, I get this error:
com.sleepycat.dbxml.XmlException: Error: External access not allowed. Cannot
resolve
collection: dbxml:c://lavori//TestRicerca//miodatabase.dbxml, errcode
= XPATH_EVALUATION_ERROR
at com.sleepycat.dbxml.dbxml_javaJNI.XmlQueryExpression_execute__SWIG_1
(Native Method)
at com.sleepycat.dbxml.XmlQueryExpression.execute
(XmlQueryExpression.java:93)
at TestRicerca.main(TestRicerca.java:71)
I get this error also if i run (copy and paste) the code provided in the
berkeley tutoial section about querying using "collection". What's wrong? i
have no problem using other db functionalities like retrive document, update,
insert with XmlModify etc... Whay i get this error using collection?
------------------------------------------
To remove yourself from this list, send an
email to [email protected]