From: Jan Pokorný <jpokorny@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/6] rgmanager: ra2rng.xsl: make common params reuse XML pretty-print
Date: Tue, 3 Dec 2013 19:26:13 +0100 [thread overview]
Message-ID: <1386095178-23404-3-git-send-email-jpokorny@redhat.com> (raw)
In-Reply-To: <1386095178-23404-1-git-send-email-jpokorny@redhat.com>
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 91 +++++++++++---------------------------
1 file changed, 25 insertions(+), 66 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 046371e..27105a0 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -1,6 +1,7 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:int="__internal__"
+ xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_namespace"
exclude-result-prefixes="int">
<xsl:output method="text" indent="no"/>
@@ -13,39 +14,24 @@
-->
<int:common-optional-parameters>
- <int:parameter name="__independent_subtree">
- <int:shortdesc>
- Treat this and all children as an independent subtree.
- </int:shortdesc>
- </int:parameter>
- <int:parameter name="__enforce_timeouts">
- <int:shortdesc>
- Consider a timeout for operations as fatal.
- </int:shortdesc>
- </int:parameter>
- <int:parameter name="__max_failures">
- <int:shortdesc>
- Maximum number of failures before returning a failure to
- a status check.
- </int:shortdesc>
- </int:parameter>
- <int:parameter name="__failure_expire_time">
- <int:shortdesc>
- Amount of time before a failure is forgotten.
- </int:shortdesc>
- </int:parameter>
- <int:parameter name="__max_restarts">
- <int:shortdesc>
- Maximum number restarts for an independent subtree before
- giving up.
- </int:shortdesc>
- </int:parameter>
- <int:parameter name="__restart_expire_time">
- <int:shortdesc>
- Amount of time before a failure is forgotten for
- an independent subtree.
- </int:shortdesc>
- </int:parameter>
+ <optional>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/>
+ </optional>
+ <optional>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/>
+ </optional>
+ <optional>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
+ </optional>
+ <optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
</int:common-optional-parameters>
<xsl:variable name="SP" select="' '"/>
@@ -381,40 +367,13 @@
select="concat($global-init-indent,
$global-indent)"/>
</xsl:call-template>
- <xsl:value-of select="$NL"/>
-
- <xsl:for-each select="document('')/*/int:common-optional-parameters/int:parameter">
- <!-- optional (start) -->
- <xsl:call-template name="tag-start">
- <xsl:with-param name="name" select="'optional'"/>
- <xsl:with-param name="indented"
- select="concat($global-init-indent,
- $global-indent)"/>
- </xsl:call-template>
- <xsl:value-of select="$NL"/>
-
- <!-- attribute name=... rha:description=... -->
- <xsl:call-template name="tag">
- <xsl:with-param name="name" select="'attribute'"/>
- <xsl:with-param name="attrs" select="concat(
- 'name=', $Q, @name, $Q, $SP,
- 'rha:description=', $Q, normalize-space(int:shortdesc), $Q)"/>
- <xsl:with-param name="indented"
- select="concat($global-init-indent,
- $global-indent,
- $global-indent)"/>
- </xsl:call-template>
- <xsl:value-of select="$NL"/>
- <!-- optional (end) -->
- <xsl:call-template name="tag-end">
- <xsl:with-param name="name" select="'optional'"/>
- <xsl:with-param name="indented"
- select="concat($global-init-indent,
- $global-indent)"/>
- </xsl:call-template>
- <xsl:value-of select="$NL"/>
- </xsl:for-each>
+ <!-- "paste" int:common-optional-parameters from above here -->
+ <xsl:call-template name="pretty-print">
+ <xsl:with-param name="indented" select="$global-init-indent"/>
+ <xsl:with-param name="fill-with"
+ select="document('')/*/int:common-optional-parameters/*"/>
+ </xsl:call-template>
<!-- optional (start) -->
<xsl:call-template name="tag-start">
--
1.8.1.4
next prev parent reply other threads:[~2013-12-03 18:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 18:26 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: build up param datatyping infra Jan Pokorný
2013-12-03 18:26 ` [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: extend infrastructure for XML Jan Pokorný
2013-12-03 18:26 ` Jan Pokorný [this message]
2013-12-03 18:26 ` [Cluster-devel] [PATCH 3/6] rgmanager: ra2rng.xsl: common params: prevent misleading combination Jan Pokorný
2013-12-03 18:26 ` [Cluster-devel] [PATCH 4/6] rgmanager: ra2rng.xsl: control flow branches common business merge Jan Pokorný
2013-12-09 14:14 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-03 18:26 ` [Cluster-devel] [PATCH 5/6] rgmanager: ra2rng.xsl: infra for param value datatyping/restriction Jan Pokorný
2013-12-09 14:15 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-03 18:26 ` [Cluster-devel] [PATCH 6/6] gmanager: ra2rng.xsl: script-file: try to prevent cluster's services Jan Pokorný
2013-12-03 18:31 ` Jan Pokorný
2013-12-03 18:26 ` [Cluster-devel] [PATCH 6/6] rgmanager: " Jan Pokorný
2013-12-04 13:50 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-09 14:16 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
2013-12-05 17:13 ` [Cluster-devel] [PATCHv2 3/6] rgmanager: ra2rng.xsl: common params: prevent misleading combination Jan Pokorný
2013-12-09 14:12 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386095178-23404-3-git-send-email-jpokorny@redhat.com \
--to=jpokorny@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).