From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Pokorný Date: Wed, 6 Feb 2013 21:47:11 +0100 Subject: [Cluster-devel] [PATCH] config/tools/xml: validate resulting cluster.rng with relaxng.rng Message-ID: <1360183631-22334-1-git-send-email-jpokorny@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Doing so will guarantee the file is valid RELAX NG schema, not just a valid XML. Validating schema, relaxng.rng, was obtained directly from [1] and matches directly to a version bundled with xmlcopyeditor in Fedora 17. The same (modulo VCS headers, comments and spacing details) can be obtained by combining schema as in the specification [2] and its errata [3]. [1] http://relaxng.org/relaxng.rng [2] http://relaxng.org/spec-20011203.html [3] http://relaxng.org/spec-20011203-errata.html Signed-off-by: Jan Pokorn? --- config/tools/xml/Makefile | 2 +- config/tools/xml/ccs_update_schema.in | 3 +- config/tools/xml/relaxng.rng | 335 ++++++++++++++++++++++++++++++++++ 3 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 config/tools/xml/relaxng.rng diff --git a/config/tools/xml/Makefile b/config/tools/xml/Makefile index 3c9e97c..a86eb01 100644 --- a/config/tools/xml/Makefile +++ b/config/tools/xml/Makefile @@ -7,7 +7,7 @@ TARGET4 = cluster.rng SBINDIRT = $(TARGET1) $(TARGET2) $(TARGET3) SHAREDIRSYMT = $(TARGET4) -RELAXNGDIRT = cluster.rng.in.head cluster.rng.in.tail +RELAXNGDIRT = cluster.rng.in.head cluster.rng.in.tail relaxng.rng all: $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) diff --git a/config/tools/xml/ccs_update_schema.in b/config/tools/xml/ccs_update_schema.in index a5aa351..16ce9f7 100644 --- a/config/tools/xml/ccs_update_schema.in +++ b/config/tools/xml/ccs_update_schema.in @@ -316,7 +316,8 @@ build_schema() { return 1 } - xmllint --noout $outputdir/cluster.rng || { + xmllint --noout --relaxng $rngdir/relaxng.rng $outputdir/cluster.rng \ + || { echo "generated schema does not pass xmllint validation" >&2 return 1 } diff --git a/config/tools/xml/relaxng.rng b/config/tools/xml/relaxng.rng new file mode 100644 index 0000000..ee6fbde --- /dev/null +++ b/config/tools/xml/relaxng.rng @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + choice + interleave + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.7.11.7