BDBXML and default namespaces

If you’re looking to do some simple XQuery work, Berkeley DB XML (BDBXML) seems to be a good answer.

The XML that I was loading into the DB has a default namespace. For example:

<?xml version="1.0" encoding="UTF-8"?>
<item xmlns=""
xsi:schemaLocation=" item.xsd">

Unfortunately BDBXML does not allow one to declare the default namespace:

xmlQueryContext.setNamespace("", "");

You must bind a prefix to the namespace and use that in any XQuery / XPath:

xmlQueryContext.setNamespace("i", "");

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s