From cbe1a272e5c45069c40f4097700499f01a767204 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Fri, 13 Mar 2009 19:59:11 +0000 Subject: [PATCH] CSPACE-12: Added a 'full' collectionObject schema in RELAX NG that includes, rather than incorporating by reference, the serviceMetadata and defaultCollectionObject schemas. This, in turn, was used as input to the 'Trang' utility to generate a W3C XML Schema (XSD) version of the collection object schema. Also included two trivial utility scripts to wrap RELAX NG validation and RELAX NG-to-XSD generation. NB: the XSD version of the collection object schema included with this commit does not include a CSpace- or Hello World-specific namespace. --- sandbox/aron/schema/collectionObject-full.rng | 271 ++++++++++++++++++ sandbox/aron/schema/collectionObject.xsd | 165 +++++++++++ sandbox/aron/schema/rng-to-xsd.sh | 18 ++ sandbox/aron/schema/validate-rng.sh | 16 ++ 4 files changed, 470 insertions(+) create mode 100644 sandbox/aron/schema/collectionObject-full.rng create mode 100644 sandbox/aron/schema/collectionObject.xsd create mode 100644 sandbox/aron/schema/rng-to-xsd.sh create mode 100644 sandbox/aron/schema/validate-rng.sh diff --git a/sandbox/aron/schema/collectionObject-full.rng b/sandbox/aron/schema/collectionObject-full.rng new file mode 100644 index 000000000..e5fb369df --- /dev/null +++ b/sandbox/aron/schema/collectionObject-full.rng @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/aron/schema/collectionObject.xsd b/sandbox/aron/schema/collectionObject.xsd new file mode 100644 index 000000000..1d8bbe89b --- /dev/null +++ b/sandbox/aron/schema/collectionObject.xsd @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/aron/schema/rng-to-xsd.sh b/sandbox/aron/schema/rng-to-xsd.sh new file mode 100644 index 000000000..7ed9aba4c --- /dev/null +++ b/sandbox/aron/schema/rng-to-xsd.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# rng-to-xsd.sh +# +# Simple bash shell script to generate a W3C XML Schema (XSD) document +# from a RELAX NG schema document. +# +# Requires two arguments: +# - Filename of the RELAX NG schema document. +# (or the full path to this document, if it is not in the current directory) +# - Filename of the new XML instance document to be created. +# (or the full path to this document, if it is not in the current directory) +# +# $Author: aron $ +# $Revision: 57 $ +# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ + +java -jar tools/trang.jar -I rng -O xsd $1 $2 \ No newline at end of file diff --git a/sandbox/aron/schema/validate-rng.sh b/sandbox/aron/schema/validate-rng.sh new file mode 100644 index 000000000..5b0e3a49e --- /dev/null +++ b/sandbox/aron/schema/validate-rng.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Simple bash shell script to validate an XML instance document +# against a RELAX NG schema. +# +# Requires two arguments: +# - Filename of the RELAX NG schema document. +# (or the full path to this document, if it is not in the current directory) +# - Filename of the XML instance document +# (or the full path to this document, if it is not in the current directory) +# +# $Author: aron $ +# $Revision: 57 $ +# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ + +java -jar tools/jing.jar $1 $2 \ No newline at end of file -- 2.47.3