If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Thursday, June 7, 2012

Managing XML Schemas and Modules with Sedna

At my customers site we use the Sedna XMLDB. In the beginning we stored all XML schemas used to validate on insertion in a custom XMLDB wrapper on top of the Sedna driver for Java. That appeared to be a bit tedious as we regularly have schema changes and we had to redeploy all projects using the XMLDB wrapper. We also stored some schemas redundantly in a Cocoon application which generates some data on the fly using transformations. We solved this problem by also storing the XML schemas in the XMLDB itself. I also installed 2 admin clients but the one I use most is SDBAdmin for windows which can be downloaded from here. It's pretty easy to connect to your database on localhost (default port is 5050). You can also use putty and setup a tunnel to your QA or PROD server.







Loading or replacing a module can be done by using following command in Query panel:
LOAD OR REPLACE MODULE "C:\workspaces\nxp\xmldbClient\src\main\resources\xquery\basictype.xqlib"

Replacing an XML schema would take two steps. If you are uploading a schema for the first time only the second command needs to be executed
DROP DOCUMENT "ChemicalContent.xsd" IN COLLECTION "xmlSchemas"

LOAD "C:/development/workspaces/intellij11/CTPI-PX/spider2/schemas/ChemicalContent.xsd" "ChemicalContent.xsd" "xmlSchemas"

You can actually also execute commands using the terminal:
pxqa1@nlscli72:/appl/spider_qa/sedna/pxqa1/sedna/bin>./se_term nxp
Welcome to term, the SEDNA Interactive Terminal. Type \? for help.
nxp> LOAD "/home/pxqa1/deployment/iso29002-10xml_V099.xml" "legacy.xml" "legacy" &
Bulk load succeeded
nxp>

No comments:

Post a Comment