How to configure Berkeley DB XML support in <oXygen/>

The latest instructions on how to configure Berkeley DB XML support in <oXygen/> can be found on our website.

The following directory definitions shall apply:

 
  1. You should have Berkeley DB XML database installed on your machine.

    http://www.sleepycat.com/products/bdbxml.html

  2. Copy Berkeley DB XML jar resources

    You have to copy the following Berkeley DB specific files in the [oXygen-install-folder]/lib directory

    • db.jar (check for it into DBXML_DIR/lib or DBXML_DIR/jar)

    • dbxml.jar (check for it into DBXML_DIR/lib or DBXML_DIR/jar)

    In case the needed jars are not found you should use --enable-java switch when you build the libraries (more info on http://www.sleepycat.com/xmldocs/ref_xml/xml_unix/intro.html). If you skip this step the application will display an error message when you try to validate or run the query.

  3. Restart the <oXygen/> application.

  4. Add Berkeley DB XML libraries directory to your PATH environment variables.

    When running the application, each of the Berkeley DB XML DLLs must be available in a directory in the PATH. You can achieve this by adding the library directory to the LD_LIBRARY_PATH (linux), DYLD_LIBRARY_PATH (OS X), or PATH (windows) environment variable. On Windows the PATH might be already changed properly by the Berkeley DB XML installation. A common example is PATH=C:\Program Files\Sleepycat Software\Berkeley DB XML 2.2.13\bin

    An alternative way is to modify the following:

    • On UNIX: Create a file called oxygen7.0.vmoptions (in case it is not already created) in the OXY_DIR. The content of the file must be: -Djava.library.path=DBXML_LIBRARY_DIR

    • On Mac: Right-click on the <oXygen/> application icon and in the pop-up menu select Show Package Contents, then in the Contents directory you edit the file Info.plist: in the key VMOptions add -Djava.library.path=DBXML_LIBRARY_DIR

  5. Configure the Berkeley DB environment.

    Go to Oxygen and open Preferences -> XML -> XSLT/FO/XQuery -> XQuery -> Berkeley DB XML to configure the environment home directory. This is the directory where your databases are stored (the DB_HOME setting). You can also set a verbosity level for the messages to be provided during execution.

  6. Configure Berkeley DB XML as main validator for XQuery files.

    Go to Preferences -> XML -> XSLT/FO/XQuery -> XQuery and set Berkeley DBXML for XQuery validation.

  7. Execute XQuery.

    Go to associated scenario configuration and select Berkeley DBXML as the transformation engine. The collections from your XQuery are automatically opened if they are available in the environment home directory you set. For example in the below Query

    <clients> {     
        for $client in collection("invoices.dbxml")
            /e5Notification/OrderNotification/Purchase/CustomerData    
        let $bc := $client//BillingContact    
        return 
        <client id="{$bc/Email/text()}">        
            <name>{$bc/LastName/text()," ",$bc/FirstName/text()}</name>        
            <company>{$bc/Company/text()}</company>        
        </client> 
    } </clients>