ESTEST Validating UR XML Documents

A good way to maintain the integrity of documents in the xquery database is to validate them against the community supported schema defined for UR XML. Valid UR XML ensures full compatibility with the xquery transforms that comprise the majority of the web interface provided to the end-user.

Prerequisite XMLBeans

Apache's XMLBeans framework is required for the validation of UR XML against schema. In particular, the executable validate from XMLBeans must be found in the system PATH; correctly following the installation instructions provided by XMLBeans will ensure this provision.

Validating a Single UR XML document

You can validate a single UR XML document on the local file system by using the validate utility from XMLBeans

$ validate -dl ABSOLUTE-PATH-TO-UR-SCHEMA test.xml

Where the argument to the -dl flag is the absolute path to the UR XML schema ur.xsd (located in www/schema under the source tree root directory) and test.xml is a UR XML document.

Validating all UR XML documents in an eXist-db Database

Newer versions of ESTEST can validate all the UR XML documents in the eXist-db database. While the eXist-db server is running, execute

$ make validate
/db/estest/db/yuangm/uploads/upload_0f4edfb2_4377_4f29_b56a_48a55eaba0e3.xml is valid
/db/estest/db/yuangm/uploads/upload_125399fb_4313_4fd1_aa63_317fb9f8c24b.xml is valid
/db/estest/db/yuangm/uploads/upload_129cc32f_7724_4128_8753_1d315cfebbcd.xml is valid
/db/estest/db/yuangm/uploads/upload_14b9329d_2b07_4ddc_a8fa_a2c8e0f32bd6.xml is valid

from the ESTEST source tree root directory.

Last modified 7 years ago Last modified on 08/25/11 12:32:29