[Cluster-devel] [PATCHv2 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node

Jan Pokorný jpokorny at redhat.com
Mon Dec 9 20:41:12 UTC 2013


...and also adjust when to put element on the new line accordingly.

Signed-off-by: Jan Pokorný <jpokorny at redhat.com>
---
 rgmanager/src/resources/ra2rng.xsl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index c939582..26218e6 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -155,8 +155,11 @@
                 </xsl:call-template>
             </xsl:when>
             <xsl:when test="self::*">
-                <xsl:if test="count($fill-with/*) < 2
-                              or count(preceding-sibling::*) = 0">
+                <xsl:if test="count(preceding-sibling::*) = 0
+                              or
+                                  (preceding-sibling::node()[comment() or *])[last()]
+                                  !=
+                                  preceding-sibling::*[last()]">
                     <xsl:value-of select="$NL"/>
                 </xsl:if>
                 <xsl:call-template name="tag">
@@ -427,7 +430,7 @@
             <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/*"/>
+                                select="document('')/*/int:common-optional-parameters/node()"/>
             </xsl:call-template>
 
             <!-- optional (start) -->
-- 
1.8.1.4




More information about the Cluster-devel mailing list