[bdbxml] XPATH_EVALUATION_ERROR

View: New views
3 Messages — Rating Filter:   Alert me  

[bdbxml] XPATH_EVALUATION_ERROR

by Maike Milling :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I have a problem with query XML-documents. I can create and open containern, put documents into the container and get documents from the container. But when I use the query

 

collection('D:/myContainer.bdbxml')/*

 

I get the following error:

com.sleepycat.dbxml.XmlException: Error: Cannot resolve collection: D:/myContainer.bdbxml, errcode = XPATH_EVALUATION_ERROR

 

What did I make wrong???

 

Thanks for your help.

Maike


Re: [bdbxml] XPATH_EVALUATION_ERROR

by George Feinberg :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Maike,

I have a problem with query XML-documents. I can create and open containern, put documents into the container and get documents from the container. But when I use the query

collection('D:/myContainer.bdbxml')/*

 I get the following error:

com.sleepycat.dbxml.XmlException: Error: Cannot resolve collection: D:/myContainer.bdbxml, errcode = XPATH_EVALUATION_ERROR


This is a known issue in release 2.1.8.  Using absolute paths
as an argument to the collection() function on Windows 
fails to resolve the argument to a BDB XML container.

The simplest workaround is to alias the container.  After you
open the container, use this method:
    container.addAlias("mycontainer");
Then, in the query, you can use:
    collection('mycontainer')/*

In general, aliasing container names is useful to eliminate 
all possibility of different paths resolving to different container
names.  It is no less efficient, internally, to use aliases.

Regards,

George



Re: [bdbxml] XPATH_EVALUATION_ERROR

by ahlandberg :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message


George Feinberg wrote:
Maike,
> I have a problem with query XML-documents. I can create and open  
> containern, put documents into the container and get documents from  
> the container. But when I use the query
>
> collection('D:/myContainer.bdbxml')/*
>
>  I get the following error:
>
> com.sleepycat.dbxml.XmlException: Error: Cannot resolve collection:  
> D:/myContainer.bdbxml, errcode = XPATH_EVALUATION_ERROR

This is a known issue in release 2.1.8.  Using absolute paths
as an argument to the collection() function on Windows
fails to resolve the argument to a BDB XML container.

The simplest workaround is to alias the container.  After you
open the container, use this method:
     container.addAlias("mycontainer");
Then, in the query, you can use:
     collection('mycontainer')/*

In general, aliasing container names is useful to eliminate
all possibility of different paths resolving to different container
names.  It is no less efficient, internally, to use aliases.

Regards,

George

Hello.

I had exactly the same problem. However, the workaround didn't work for me. I have BDBXML 2.3.10.

I have tried the following:

I created an alias for my container

myContainer.addAlias("myContainerAlias");

Then I set the base uri to empty, after realising that giving it the absolute path was useless:

queryContext.setBaseURI( containerURL );

and also

queryContext.setBaseURI( "" );

Then I set my query to:

String myQuery = "collection('myContainerAlias')/phonebook";

But I got this error:

Query Expression: collection('myContainerAlias')/phonebook
com.sleepycat.dbxml.XmlException: Error: External access not allowed.  Cannot resolve
        collection: D:/dev/workspace/BDBXML/xml_containers/myContainerAlias, errcode = XPATH_EVALUATION_ERROR


What's wrong here?

Cheers, Anders
LightInTheBox - Buy quality products at wholesale price