/usr/share/cluster/relaxng/fence2rng.xsl is in fence-agents 4.0.22-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no"/>
<xsl:param name="init-indent" select="' '"/>
<xsl:param name="indent" select="' '"/>
<!--
helpers
-->
<xsl:variable name="SP" select="' '"/>
<xsl:variable name="NL" select="'
'"/>
<xsl:variable name="Q" select="'"'"/>
<xsl:variable name="TS" select="'<'"/>
<xsl:variable name="TSc" select="'</'"/>
<xsl:variable name="TE" select="'>'"/>
<xsl:variable name="TEc" select="'/>'"/>
<xsl:template name="comment">
<xsl:param name="text" select="''"/>
<xsl:param name="indent" select="''"/>
<xsl:if test="$indent != 'none'">
<xsl:value-of select="concat($init-indent, $indent)"/>
</xsl:if>
<xsl:value-of select="concat($TS, '!-- ', $text, ' --',$TE)"/>
</xsl:template>
<xsl:template name="tag-start">
<xsl:param name="name"/>
<xsl:param name="attrs" select="''"/>
<xsl:param name="indent" select="''"/>
<xsl:if test="$indent != 'none'">
<xsl:value-of select="concat($init-indent, $indent)"/>
</xsl:if>
<xsl:value-of select="concat($TS, $name)"/>
<xsl:if test="$attrs != ''">
<xsl:value-of select="concat($SP, $attrs)"/>
</xsl:if>
<xsl:value-of select="$TE"/>
</xsl:template>
<xsl:template name="tag-end">
<xsl:param name="name"/>
<xsl:param name="attrs" select="''"/>
<xsl:param name="indent" select="''"/>
<xsl:if test="$indent != 'none'">
<xsl:value-of select="concat($init-indent, $indent)"/>
</xsl:if>
<xsl:value-of select="concat($TSc, $name)"/>
<xsl:if test="$attrs != ''">
<xsl:value-of select="concat($SP, $attrs)"/>
</xsl:if>
<xsl:value-of select="$TE"/>
</xsl:template>
<xsl:template name="tag-self">
<xsl:param name="name"/>
<xsl:param name="attrs" select="''"/>
<xsl:param name="indent" select="''"/>
<xsl:if test="$indent != 'none'">
<xsl:value-of select="concat($init-indent, $indent)"/>
</xsl:if>
<xsl:value-of select="concat($TS, $name)"/>
<xsl:if test="$attrs != ''">
<xsl:value-of select="concat($SP, $attrs)"/>
</xsl:if>
<xsl:value-of select="$TEc"/>
</xsl:template>
<!--
proceed
-->
<xsl:template match="/resource-agent">
<xsl:value-of select="$NL"/>
<!-- (comment denoting the fence agent name) -->
<xsl:call-template name="comment">
<xsl:with-param name="text" select="@name"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
<!-- group rha:name=... rha:description=... (start) -->
<xsl:call-template name="tag-start">
<xsl:with-param name="name" select="'group'"/>
<xsl:with-param name="attrs" select="concat(
'rha:name=', $Q, @name, $Q, $SP,
'rha:description=', $Q, @shortdesc, $Q)"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
<!-- optional (start) -->
<xsl:call-template name="tag-start">
<xsl:with-param name="name" select="'optional'"/>
<xsl:with-param name="indent" select="$indent"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
<!-- attribute name="option" -->
<xsl:call-template name="tag-self">
<xsl:with-param name="name" select="'attribute'"/>
<xsl:with-param name="attrs" select="concat(
'name=', $Q, 'option', $Q)"/>
<xsl:with-param name="indent" select="concat($indent, $indent)"/>
</xsl:call-template>
<xsl:value-of select="$SP"/>
<!-- (comment mentioning that "option" is deprecated) -->
<xsl:call-template name="comment">
<xsl:with-param name="text">
<xsl:text>deprecated; for compatibility. use "action"</xsl:text>
</xsl:with-param>
<xsl:with-param name="indent" select="'none'"/>
</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="indent" select="$indent"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
<xsl:for-each select="parameters/parameter">
<xsl:variable name="escapeddesc">
<xsl:call-template name="escape_quot">
<xsl:with-param name="replace" select="shortdesc"/>
</xsl:call-template>
</xsl:variable>
<!-- optional (start) -->
<xsl:call-template name="tag-start">
<xsl:with-param name="name" select="'optional'"/>
<xsl:with-param name="indent" select="$indent"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
<!-- attribute name=... rha:description=... -->
<xsl:call-template name="tag-self">
<xsl:with-param name="name" select="'attribute'"/>
<xsl:with-param name="attrs" select="concat(
'name=', $Q, @name, $Q, $SP,
'rha:description=', $Q, normalize-space($escapeddesc), $Q, $SP)"/>
<xsl:with-param name="indent" select="concat($indent, $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="indent" select="$indent"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
</xsl:for-each>
<!-- group rha:name=... rha:description=... (end) -->
<xsl:call-template name="tag-end">
<xsl:with-param name="name" select="'group'"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
<xsl:value-of select="$NL"/>
</xsl:template>
<xsl:template name="escape_quot">
<xsl:param name="replace"/>
<xsl:choose>
<xsl:when test="contains($replace,'"')">
<xsl:value-of select="substring-before($replace,'"')"/>
<!-- escape quot-->
<xsl:text>&quot;</xsl:text>
<xsl:call-template name="escape_quot">
<xsl:with-param name="replace" select="substring-after($replace,'"')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$replace"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|