From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Pokorný Date: Mon, 16 Dec 2013 13:38:22 +0100 Subject: [Cluster-devel] [PATCH 2/2] rgmanager: ra2rng.xsl et al.: enforce "forbid child" from RA metadata In-Reply-To: <1387197502-11551-1-git-send-email-jpokorny@redhat.com> References: <1387197502-11551-1-git-send-email-jpokorny@redhat.com> Message-ID: <1387197502-11551-3-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 As with previous change, the reflection of this change is yet to come to cluster.git (ccs_update_schema script) via a separate patch. Note that this effectively adds requirement for xmllint/libxml2, but it is required by xsltproc/libxslt already anyway. Also note that this provision to schema generation will not work properly until libxslt bugfix [1] is propagated to the target deployment. [1] https://mail.gnome.org/archives/xslt/2013-December/msg00001.html Signed-off-by: Jan Pokorn? --- rgmanager/src/resources/Makefile.am | 15 +- rgmanager/src/resources/ra2rng-postprocess.xsl | 265 +++++++++++++++++++++++++ rgmanager/src/resources/ra2rng.xsl | 12 ++ 3 files changed, 287 insertions(+), 5 deletions(-) create mode 100644 rgmanager/src/resources/ra2rng-postprocess.xsl diff --git a/rgmanager/src/resources/Makefile.am b/rgmanager/src/resources/Makefile.am index caeb947..00435f7 100644 --- a/rgmanager/src/resources/Makefile.am +++ b/rgmanager/src/resources/Makefile.am @@ -105,12 +105,17 @@ ras-validation: $(RESOURCES) $(TARGET) $(DTD) resources.rng: $(RESOURCES) $(TARGET) utils/config-utils.sh resources.rng: $(XSL) $(RESRNG) rm -f resources.rng - cat resources.rng.head >> resources.rng @echo Generating per-resource RelaxNG information... - @for f in $(RESOURCES) $(TARGET); do \ - echo " ./$$f"; \ - bash ./$$f meta-data | xsltproc ra2rng.xsl - >> resources.rng; \ - done + cat resources.rng.head >> resources.rng + @{ echo ''; \ + for f in $(RESOURCES) $(TARGET); do \ + echo " ./$$f" >&2; \ + bash ./$$f meta-data | xsltproc ra2rng.xsl -; \ + done; \ + echo ''; } \ + | xsltproc ra2rng-postprocess.xsl - \ + | xmllint --xpath '/*[local-name() = "wrap"]/node()' - \ + >> resources.rng cat resources.rng.mid >> resources.rng cat resources.rng.tail >> resources.rng diff --git a/rgmanager/src/resources/ra2rng-postprocess.xsl b/rgmanager/src/resources/ra2rng-postprocess.xsl new file mode 100644 index 0000000..066efb3 --- /dev/null +++ b/rgmanager/src/resources/ra2rng-postprocess.xsl @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl index 5b9a307..71df682 100644 --- a/rgmanager/src/resources/ra2rng.xsl +++ b/rgmanager/src/resources/ra2rng.xsl @@ -489,6 +489,18 @@ + + + + + + + + + -- 1.8.1.4