From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Pokorný Date: Mon, 16 Dec 2013 13:58:35 +0100 Subject: [Cluster-devel] [PATCH] rgmanager: ra2rng.xsl et al.: enforce "forbid child" from RA metadata In-Reply-To: <1387197502-11551-3-git-send-email-jpokorny@redhat.com> References: <1387197502-11551-3-git-send-email-jpokorny@redhat.com> Message-ID: <1387198715-21898-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 As with previous change, the reflection of this change is yet to come to cluster.git (ccs_update_schema script) via a separate patch. There is a new file included in "DIST", ra2rng-postprocess.xsl, that is to be appended to a pipe with original ra2rng.xsl (both with xsltproc as an effective actor, indeed), that in turn now requires some extra decoration as can be found also in the respective Makefile.am. 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 | 17 +- rgmanager/src/resources/ra2rng-postprocess.xsl | 265 +++++++++++++++++++++++++ rgmanager/src/resources/ra2rng.xsl | 12 ++ 3 files changed, 288 insertions(+), 6 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..af350a9 100644 --- a/rgmanager/src/resources/Makefile.am +++ b/rgmanager/src/resources/Makefile.am @@ -41,7 +41,7 @@ HELPERS = ocf-shellfuncs svclib_nfslock \ DTD = ra-api-1-modified.dtd -XSL = ra2man.xsl ra2ref.xsl ra2rng.xsl +XSL = ra2man.xsl ra2ref.xsl ra2rng.xsl ra2rng-postprocess.xsl RESRNG = resources.rng.head resources.rng.mid resources.rng.tail @@ -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