| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2" |
| exclude-result-prefixes="cibtr"> |
| <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> |
| |
| <xsl:param name="cibtr:cib-min-ver" select="'3.0'"/> |
| <xsl:param name="cibtr:label-warning" select="'WARNING: '"/> |
| <xsl:param name="cibtr:label-info" select="'INFO: '"/> |
| <xsl:param name="cibtr:label-debug" select="'DEBUG: '"/> |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:map> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="cluster-properties" msg-prefix="Cluster properties" |
| where-cases="op_defaults|rsc_defaults"> |
| <cibtr:replace what="cluster-infrastructure" |
| with="" |
| in-case-of="heartbeat|openais|classic openais|classic openais (with plugin)|cman" |
| msg-extra="corosync (2+) infrastructure can be used instead, though the value is not of significance"/> |
| |
| <cibtr:replace what="cluster_recheck_interval" |
| with="cluster-recheck-interval"/> |
| <cibtr:replace what="dc_deadtime" |
| with="dc-deadtime"/> |
| |
| <cibtr:replace what="default-action-timeout" |
| with="timeout" |
| where="op_defaults"/> |
| <cibtr:replace what="default_action_timeout" |
| with="timeout" |
| where="op_defaults"/> |
| |
| <cibtr:replace what="default-migration-threshold" |
| with="" |
| msg-extra="migration-threshold in rsc_defaults can be configured instead"/> |
| <cibtr:replace what="default_migration_threshold" |
| with="" |
| msg-extra="migration-threshold in rsc_defaults can be configured instead"/> |
| |
| <cibtr:replace what="default-resource-stickiness" |
| with="resource-stickiness" |
| where="rsc_defaults"/> |
| <cibtr:replace what="default_resource_stickiness" |
| with="resource-stickiness" |
| where="rsc_defaults"/> |
| |
| <cibtr:replace what="default-resource-failure-stickiness" |
| with="migration-threshold" |
| where="rsc_defaults" |
| in-case-of="-INFINITY" |
| redefined-as="1"/> |
| <cibtr:replace what="default-resource-failure-stickiness" |
| with="" |
| msg-extra="migration-threshold in rsc_defaults can be configured instead"/> |
| <cibtr:replace what="default_resource_failure_stickiness" |
| with="migration-threshold" |
| where="rsc_defaults" |
| in-case-of="-INFINITY" |
| redefined-as="1"/> |
| <cibtr:replace what="default_resource_failure_stickiness" |
| with="" |
| msg-extra="migration-threshold in rsc_defaults can be configured instead"/> |
| |
| <cibtr:replace what="election_timeout" |
| with="election-timeout"/> |
| <cibtr:replace what="expected-quorum-votes" |
| with="" |
| msg-extra="corosync (2+) infrastructure tracks quorum on its own"/> |
| |
| <cibtr:replace what="is-managed-default" |
| with="is-managed" |
| where="rsc_defaults"/> |
| <cibtr:replace what="is_managed_default" |
| with="is-managed" |
| where="rsc_defaults"/> |
| <cibtr:replace what="no_quorum_policy" |
| with="no-quorum-policy"/> |
| |
| <cibtr:replace what="notification-agent" |
| with="" |
| msg-extra="standalone alerts can be configured instead"/> |
| <cibtr:replace what="notification-recipient" |
| with="" |
| msg-extra="standalone alerts can be configured instead"/> |
| |
| <cibtr:replace what="remove_after_stop" |
| with="remove-after-stop"/> |
| <cibtr:replace what="shutdown_escalation" |
| with="shutdown-escalation"/> |
| <cibtr:replace what="startup_fencing" |
| with="startup-fencing"/> |
| <cibtr:replace what="stonith_action" |
| with="stonith-action"/> |
| <cibtr:replace what="stonith_enabled" |
| with="stonith-enabled"/> |
| <cibtr:replace what="stop_orphan_actions" |
| with="stop-orphan-actions"/> |
| <cibtr:replace what="stop_orphan_resources" |
| with="stop-orphan-resources"/> |
| <cibtr:replace what="symmetric_cluster" |
| with="symmetric-cluster"/> |
| <cibtr:replace what="transition_idle_timeout" |
| with="cluster-delay"/> |
| </cibtr:table> |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="cluster-node" msg-prefix="Cluster node"> |
| <cibtr:replace what="type" |
| with="type" |
| in-case-of="normal" |
| redefined-as="member"/> |
| </cibtr:table> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="resource-instance-attributes" msg-prefix="Resource instance_attributes"> |
| <cibtr:replace what="pcmk_arg_map" |
| with=""/> |
| |
| |
| |
| <cibtr:replace what="pcmk_arg_map" |
| with="pcmk_host_argument" |
| in-case-of-droppable-prefix="port:"/> |
| |
| <cibtr:replace what="pcmk_list_cmd" |
| with="pcmk_list_action"/> |
| <cibtr:replace what="pcmk_monitor_cmd" |
| with="pcmk_monitor_action"/> |
| <cibtr:replace what="pcmk_off_cmd" |
| with="pcmk_off_action"/> |
| <cibtr:replace what="pcmk_on_cmd" |
| with="pcmk_on_action"/> |
| <cibtr:replace what="pcmk_reboot_cmd" |
| with="pcmk_reboot_action"/> |
| <cibtr:replace what="pcmk_status_cmd" |
| with="pcmk_status_action"/> |
| </cibtr:table> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="resource-meta-attributes" msg-prefix="Resource meta_attributes"> |
| <cibtr:replace what="isolation" |
| with="target-role" |
| redefined-as="Stopped" |
| msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" |
| msg-severity="WARNING"/> |
| <cibtr:replace what="isolation-host" |
| with="target-role" |
| redefined-as="Stopped" |
| msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" |
| msg-severity="WARNING"/> |
| <cibtr:replace what="isolation-instance" |
| with="target-role" |
| redefined-as="Stopped" |
| msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" |
| msg-severity="WARNING"/> |
| <cibtr:replace what="isolation-wrapper" |
| with="target-role" |
| redefined-as="Stopped" |
| msg-extra="i.e. resource at hand disabled; isolation wrappers obsoleted with bundle resources" |
| msg-severity="WARNING"/> |
| |
| <cibtr:replace what="resource-failure-stickiness" |
| with="migration-threshold" |
| in-case-of="-INFINITY" |
| redefined-as="1"/> |
| <cibtr:replace what="resource-failure-stickiness" |
| with="" |
| msg-extra="migration-threshold can be configured instead"/> |
| <cibtr:replace what="resource_failure_stickiness" |
| with="migration-threshold" |
| in-case-of="-INFINITY" |
| redefined-as="1"/> |
| <cibtr:replace what="resource_failure_stickiness" |
| with="" |
| msg-extra="migration-threshold can be configured instead"/> |
| </cibtr:table> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="resources-operation" msg-prefix="Resources-operation" |
| where-cases="meta_attributes"> |
| |
| <cibtr:replace what="requires" |
| with="" |
| msg-extra="only start/promote operation taken into account"/> |
| <cibtr:replace what="requires" |
| with="requires" |
| in-case-of="start|promote" |
| where="meta_attributes"/> |
| </cibtr:table> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="resource-operation-instance-attributes" |
| msg-prefix="Resources-operation instance_attributes" |
| where-cases="meta_attributes|per-resource-meta_attributes"> |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:replace what="requires" |
| with="" |
| msg-extra="only start/promote operation taken into account"/> |
| <cibtr:replace what="requires" |
| with="requires" |
| in-case-of="start|promote" |
| where="per-resource-meta_attributes"/> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:replace what="interval-origin" |
| with="interval-origin" |
| where="meta_attributes"/> |
| <cibtr:replace what="start-delay" |
| with="start-delay" |
| where="meta_attributes"/> |
| |
| <cibtr:replace what="enabled" |
| with="enabled" |
| where="meta_attributes"/> |
| <cibtr:replace what="on-fail" |
| with="on-fail" |
| where="meta_attributes"/> |
| <cibtr:replace what="record-pending" |
| with="record-pending" |
| where="meta_attributes"/> |
| <cibtr:replace what="role" |
| with="role" |
| where="meta_attributes"/> |
| <cibtr:replace what="timeout" |
| with="timeout" |
| where="meta_attributes"/> |
| </cibtr:table> |
| |
| |
| |
| |
| |
| |
| |
| |
| <cibtr:table for="constraints-colocation" msg-prefix="Constraints-colocation"> |
| <cibtr:replace what="score-attribute" |
| with="" |
| msg-extra="was actually never in effect"/> |
| <cibtr:replace what="score-attribute-mangle" |
| with="" |
| msg-extra="was actually never in effect"/> |
| </cibtr:table> |
| |
| </cibtr:map> |
| |
| <xsl:variable name="cibtr:MapClusterProperties" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'cluster-properties' |
| ]"/> |
| |
| <xsl:variable name="cibtr:MapClusterNode" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'cluster-node' |
| ]"/> |
| |
| <xsl:variable name="cibtr:MapResourceInstanceAttributes" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'resource-instance-attributes' |
| ]"/> |
| |
| <xsl:variable name="cibtr:MapResourceMetaAttributes" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'resource-meta-attributes' |
| ]"/> |
| |
| <xsl:variable name="cibtr:MapResourcesOperation" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'resources-operation' |
| ]"/> |
| |
| <xsl:variable name="cibtr:MapResourcesOperationInstanceAttributes" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'resource-operation-instance-attributes' |
| ]"/> |
| |
| <xsl:variable name="cibtr:MapConstraintsColocation" |
| select="document('')/xsl:stylesheet |
| /cibtr:map/cibtr:table[ |
| @for = 'constraints-colocation' |
| ]"/> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:HelperIdentity"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*|node()" |
| mode="cibtr:main"/> |
| </xsl:copy> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:MapMsg"> |
| <xsl:param name="Context" select="''"/> |
| <xsl:param name="Replacement"/> |
| <xsl:choose> |
| <xsl:when test="not($Replacement)"/> |
| <xsl:when test="count($Replacement) != 1"> |
| <xsl:message terminate="yes"> |
| <xsl:value-of select="concat('INTERNAL ERROR: ', |
| $Replacement/../@msg-prefix, |
| ': count($Replacement) != 1', |
| ' does not hold (', |
| count($Replacement), ')')"/> |
| </xsl:message> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:variable name="MsgPrefix" select="concat( |
| ($Replacement|$Replacement/..) |
| /@msg-prefix, ': ' |
| )"/> |
| <xsl:variable name="MsgSeverity"> |
| <xsl:choose> |
| <xsl:when test="$Replacement/@msg-severity"> |
| <xsl:value-of select="$Replacement/@msg-severity"/> |
| </xsl:when> |
| <xsl:when test="$Replacement/@msg-extra"> |
| <xsl:value-of select="'INFO'"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="'DEBUG'"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:variable> |
| <xsl:variable name="MsgSeverityLabel"> |
| <xsl:choose> |
| <xsl:when test="$MsgSeverity = 'WARNING'"> |
| <xsl:value-of select="$cibtr:label-warning"/> |
| </xsl:when> |
| <xsl:when test="$MsgSeverity = 'INFO'"> |
| <xsl:value-of select="$cibtr:label-info"/> |
| </xsl:when> |
| <xsl:when test="$MsgSeverity = 'DEBUG'"> |
| <xsl:value-of select="$cibtr:label-debug"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:message terminate="yes"> |
| <xsl:value-of select="concat('INTERNAL ERROR: not a valid', |
| ' severity specification: ', |
| $MsgSeverity)"/> |
| </xsl:message> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:variable> |
| <xsl:if test="string($MsgSeverityLabel) != string(false())"> |
| <xsl:message> |
| <xsl:value-of select="concat($MsgSeverityLabel, $MsgPrefix)"/> |
| <xsl:if test="$Context"> |
| <xsl:value-of select="concat($Context, ': ')"/> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="string($Replacement/@with)"> |
| <xsl:choose> |
| <xsl:when test="string($Replacement/@where)"> |
| <xsl:if test="not( |
| contains( |
| concat('|', $Replacement/../@where-cases, '|'), |
| concat('|', $Replacement/@where, '|') |
| ) |
| )"> |
| <xsl:message terminate="yes"> |
| <xsl:value-of select="concat('INTERNAL ERROR:', |
| $Replacement/../@msg-prefix, |
| ': $Replacement/@where (', |
| $Replacement/@where, ') not in ', |
| concat('|', |
| $Replacement/../@where-cases, |
| '|'))"/> |
| </xsl:message> |
| </xsl:if> |
| <xsl:value-of select="concat('moving ', $Replacement/@what, |
| ' under ', $Replacement/@where)"/> |
| </xsl:when> |
| <xsl:when test="$Replacement/@with = $Replacement/@what"> |
| <xsl:value-of select="concat('keeping ', $Replacement/@what)"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="concat('renaming ', $Replacement/@what)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| <xsl:value-of select="concat(' as ', $Replacement/@with)"/> |
| <xsl:if test="$Replacement/@where"> |
| <xsl:value-of select="' unless already defined there'"/> |
| </xsl:if> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="concat('dropping ', $Replacement/@what)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| <xsl:if test="string($Replacement/@redefined-as)"> |
| <xsl:value-of select="concat(', redefined as ', |
| $Replacement/@redefined-as)"/> |
| <xsl:if test="$Replacement/@in-case-of"> |
| <xsl:value-of select="','"/> |
| </xsl:if> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="string($Replacement/@in-case-of)"> |
| <xsl:value-of select="concat(' for matching ', |
| $Replacement/@in-case-of)"/> |
| </xsl:when> |
| <xsl:when test="$Replacement/@in-case-of"> |
| <xsl:value-of select="' for matching "empty string"'"/> |
| </xsl:when> |
| <xsl:when test="$Replacement/@in-case-of-droppable-prefix"> |
| <xsl:value-of select="concat(' for matching ', |
| $Replacement/@in-case-of-droppable-prefix, |
| ' prefix that will, meanwhile, get dropped' |
| )"/> |
| </xsl:when> |
| </xsl:choose> |
| </xsl:message> |
| <xsl:if test="$Replacement/@msg-extra"> |
| <xsl:message> |
| <xsl:value-of select="concat($MsgSeverityLabel, $MsgPrefix, '... ', |
| $Replacement/@msg-extra)"/> |
| </xsl:message> |
| </xsl:if> |
| </xsl:if> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:param name="Source"/> |
| <xsl:param name="ResultTreeFragment" select="false()"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:choose> |
| <xsl:when test="not($ResultTreeFragment)"> |
| |
| |
| |
| <xsl:variable name="ExistingSpace" |
| select="$Source/preceding-sibling::node()[ |
| ( |
| self::comment() |
| or |
| self::text() |
| ) |
| and |
| generate-id(following-sibling::*[1]) |
| = generate-id($Source) |
| ]"/> |
| <xsl:copy-of select="$ExistingSpace"/> |
| <xsl:if test="not( |
| $ExistingSpace/self::text()[ |
| normalize-space(.) != string(.) |
| ] |
| ) and $InnerSimulation"> |
| <xsl:text> </xsl:text> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="normalize-space($Source) |
| != string($Source)"> |
| <xsl:text> </xsl:text> |
| </xsl:when> |
| </xsl:choose> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessClusterProperties"> |
| <xsl:param name="Source"/> |
| <xsl:param name="InverseMode" select="false()"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InverseMode" select="$InverseMode"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| <xsl:for-each select="$Source/node()"> |
| <xsl:choose> |
| <xsl:when test="self::text()"> |
| |
| <xsl:choose> |
| <xsl:when test="normalize-space($InnerPass) |
| != $InnerPass |
| and |
| ( |
| not(following-sibling::nvpair) |
| or |
| generate-id(following-sibling::nvpair[1]) |
| != generate-id(following-sibling::*[1]) |
| )"> |
| <xsl:value-of select="."/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="normalize-space(.)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="self::nvpair"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapClusterProperties/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/@value, '|')) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not( |
| $cibtr:MapClusterProperties/cibtr:replace[ |
| @what = current()/@name |
| and |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/@value, '|')) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" select="@id"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| ( |
| not(string($Replacement/@with)) |
| or |
| $Replacement/@where |
| )"> |
| |
| <xsl:if test="$Replacement/@where |
| and |
| ( |
| ( |
| normalize-space($InverseMode) |
| and |
| $Replacement/@where = $InverseMode |
| ) |
| or |
| ( |
| not(normalize-space($InverseMode)) |
| and |
| (true() or count($InverseMode)) |
| and |
| not( |
| $InverseMode/nvpair[ |
| @name = $Replacement/@with |
| ] |
| ) |
| and |
| $Replacement/@where = name($InverseMode/..) |
| ) |
| )"> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:copy> |
| <xsl:for-each select="@*"> |
| <xsl:choose> |
| <xsl:when test="name() = 'name'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@with"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:when test="string($Replacement/@redefined-as) |
| and |
| name() = 'value'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@redefined-as"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="$InverseMode"/> |
| <xsl:when test="$Replacement"> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:copy> |
| <xsl:for-each select="@*"> |
| <xsl:choose> |
| <xsl:when test="name() = 'name'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@with"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:when test="string($Replacement/@redefined-as) |
| and |
| name() = 'value'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@redefined-as"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| </xsl:copy> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="$InverseMode |
| or |
| self::comment()"> |
| |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessRscInstanceAttributes"> |
| <xsl:param name="Source"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessRscInstanceAttributes"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| |
| <xsl:for-each select="$Source/node()"> |
| <xsl:choose> |
| <xsl:when test="self::text()"> |
| |
| <xsl:choose> |
| <xsl:when test="normalize-space($InnerPass) |
| != $InnerPass |
| and |
| ( |
| not(following-sibling::nvpair) |
| or |
| generate-id(following-sibling::nvpair[1]) |
| != generate-id(following-sibling::*[1]) |
| )"> |
| <xsl:value-of select="."/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="normalize-space(.)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="self::nvpair"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapResourceInstanceAttributes/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/@value, '|')) |
| ) |
| or |
| ( |
| @in-case-of-droppable-prefix |
| and |
| starts-with(current()/@value, |
| @in-case-of-droppable-prefix) |
| and |
| not( |
| contains(current()/@value, ',') |
| ) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not(@in-case-of-droppable-prefix) |
| and |
| not( |
| $cibtr:MapResourceInstanceAttributes/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/@value, '|')) |
| ) |
| or |
| ( |
| @in-case-of-droppable-prefix |
| and |
| starts-with(current()/@value, |
| @in-case-of-droppable-prefix) |
| and |
| not( |
| contains(current()/@value, ',') |
| ) |
| ) |
| ) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" select="@id"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| not(string($Replacement/@with))"> |
| |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:copy> |
| <xsl:for-each select="@*"> |
| <xsl:choose> |
| <xsl:when test="name() = 'name'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@with"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:when test="string($Replacement/@redefined-as) |
| and |
| name() = 'value'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@redefined-as"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:when test="string($Replacement/@in-case-of-droppable-prefix) |
| and |
| name() = 'value'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="substring-after( |
| ., $Replacement/@in-case-of-droppable-prefix |
| )"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| </xsl:copy> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessRscMetaAttributes"> |
| <xsl:param name="Source"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| |
| <xsl:for-each select="$Source/node()"> |
| <xsl:choose> |
| <xsl:when test="self::text()"> |
| |
| <xsl:choose> |
| <xsl:when test="normalize-space($InnerPass) |
| != $InnerPass |
| and |
| ( |
| not(following-sibling::nvpair) |
| or |
| generate-id(following-sibling::nvpair[1]) |
| != generate-id(following-sibling::*[1]) |
| )"> |
| <xsl:value-of select="."/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="normalize-space(.)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="self::nvpair"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapResourceMetaAttributes/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/@value, '|')) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not( |
| $cibtr:MapResourceMetaAttributes/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/@value, '|')) |
| ) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" |
| select="concat(../../@id, |
| ' (meta=', ../@id, |
| ')')"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| not(string($Replacement/@with))"> |
| |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| |
| <xsl:variable name="SimulateFollowingSiblings"> |
| |
| <xsl:for-each select="(..|../following-sibling::meta_attributes)[ |
| not(rule) |
| ]"> |
| <xsl:if test="$InnerPass != 'TRIGGER-RECURSION'"> |
| <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" select="'TRIGGER-RECURSION'"/> |
| </xsl:call-template> |
| </xsl:if> |
| </xsl:for-each> |
| </xsl:variable> |
| <xsl:choose> |
| |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="concat(generate-id(), '@', $Replacement/@with, ' ')"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:if test="not( |
| contains($SimulateFollowingSiblings, |
| concat($Replacement/@with, ' ')) |
| ) |
| or |
| generate-id() |
| = |
| substring-before($SimulateFollowingSiblings, |
| concat('@', $Replacement/@with))"> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:copy> |
| <xsl:for-each select="@*"> |
| <xsl:choose> |
| <xsl:when test="name() = 'name'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@with"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:when test="string($Replacement/@redefined-as) |
| and |
| name() = 'value'"> |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@redefined-as"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:param name="Source"/> |
| <xsl:param name="InverseMode" select="false()"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| <xsl:variable name="EnclosingTag" select="../../.."/> |
| |
| |
| <xsl:for-each select="$Source/node()"> |
| <xsl:choose> |
| <xsl:when test="self::text()"> |
| |
| <xsl:choose> |
| <xsl:when test="normalize-space($InnerPass) |
| != $InnerPass |
| and |
| ( |
| not(following-sibling::nvpair) |
| or |
| generate-id(following-sibling::nvpair[1]) |
| != generate-id(following-sibling::*[1]) |
| )"> |
| <xsl:value-of select="."/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="normalize-space(.)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="self::nvpair"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapResourcesOperationInstanceAttributes/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/../../@name, '|')) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not( |
| $cibtr:MapResourcesOperationInstanceAttributes/cibtr:replace[ |
| @what = current()/@name |
| and |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/../../@name, '|')) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" |
| select="concat(../../@id, |
| ' (rsc=', $EnclosingTag/@id, |
| ', meta=', ../@id, |
| ')')"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| ( |
| not(string($Replacement/@with)) |
| or |
| $Replacement/@where |
| )"> |
| |
| <xsl:variable name="SimulateAttrOverrides"> |
| <xsl:for-each select="../../../op"> |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| <xsl:if test="$InverseMode |
| and |
| not( |
| contains($SimulateAttrOverrides, |
| concat(@name, ' ')) |
| )"> |
| |
| |
| |
| |
| <xsl:variable name="SimulateFollowingSiblingsMeta"> |
| |
| |
| <xsl:for-each select="(../following-sibling::meta_attributes |
| |../../following-sibling::op/meta_attributes)[ |
| not(rule) |
| ]"> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| <xsl:variable name="SimulateFollowingSiblingsInstance"> |
| <xsl:for-each select="../following-sibling::instance_attributes[ |
| not(rule) |
| ]"> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| <xsl:if test="$Replacement/@where = 'meta_attributes' |
| and |
| not( |
| $EnclosingTag/meta_attributes[ |
| not(rule) |
| and |
| nvpair/@name = $Replacement/@with |
| ] |
| ) |
| and |
| not( |
| contains($SimulateFollowingSiblingsInstance, |
| concat(@name, ' ')) |
| )"> |
| |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| |
| <xsl:value-of select="concat(@name, ' ')"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| </xsl:copy> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:if> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| <xsl:message terminate="yes"> |
| <xsl:value-of select="concat('INTERNAL ERROR: ', |
| $Replacement/../@msg-prefix, |
| ': no in-situ rename', |
| ' does not hold (', |
| not(($InverseMode)), ')')"/> |
| </xsl:message> |
| </xsl:when> |
| <xsl:when test="$InverseMode"/> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="$InverseMode |
| or |
| self::comment()"> |
| |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:param name="Source"/> |
| <xsl:param name="InverseMode" select="false()"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| <xsl:variable name="EnclosingTag" select="../../.."/> |
| |
| <xsl:for-each select="$Source/node()"> |
| <xsl:choose> |
| <xsl:when test="self::text() |
| and |
| not($InverseMode)"> |
| |
| <xsl:choose> |
| <xsl:when test="normalize-space($InnerPass) |
| != $InnerPass |
| and |
| ( |
| not(following-sibling::nvpair) |
| or |
| generate-id(following-sibling::nvpair[1]) |
| != generate-id(following-sibling::*[1]) |
| )"> |
| <xsl:value-of select="."/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="normalize-space(.)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="self::nvpair"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapResourcesOperation/cibtr:replace[ |
| @what = current()/@name |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/../../@name, '|')) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not( |
| $cibtr:MapResourcesOperation/cibtr:replace[ |
| @what = current()/@name |
| and |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/../../@name, '|')) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" |
| select="concat(../../@id, |
| ' (rsc=', $EnclosingTag/@id, |
| ', meta=', ../@id, |
| ')')"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| ( |
| not(string($Replacement/@with)) |
| or |
| $Replacement/@where |
| )"> |
| |
| <xsl:if test="$InverseMode"> |
| <xsl:variable name="SimulateAttrOverrides"> |
| <xsl:for-each select="../../../op"> |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| <xsl:if test="not( |
| contains($SimulateAttrOverrides, |
| concat(@name, ' ')) |
| )"> |
| |
| |
| |
| |
| |
| |
| <xsl:variable name="SimulateFollowingSiblings"> |
| |
| |
| <xsl:if test="name(..) = 'meta_attributes'"> |
| <xsl:for-each select="(../following-sibling::meta_attributes |
| |../../following-sibling::op/meta_attributes)[ |
| not(rule) |
| ]"> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:if> |
| <xsl:if test="name(..) = 'instance_attributes'"> |
| <xsl:for-each select="(../following-sibling::instance_attributes |
| |../../following-sibling::op/instance_attributes |
| |../../meta_attributes |
| |../../../op/meta_attributes)[ |
| not(rule) |
| ]"> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:if> |
| </xsl:variable> |
| <xsl:if test="$Replacement/@where = 'meta_attributes' |
| and |
| not( |
| $EnclosingTag/meta_attributes[ |
| not(rule) |
| and |
| nvpair/@name = $Replacement/@with |
| ] |
| ) |
| and |
| not( |
| contains($SimulateFollowingSiblings, |
| concat(@name, ' ')) |
| )"> |
| |
| <xsl:choose> |
| |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="concat(@name, ' ')"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| </xsl:copy> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:if> |
| </xsl:if> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| <xsl:message terminate="yes"> |
| <xsl:value-of select="concat('INTERNAL ERROR: ', |
| $Replacement/../@msg-prefix, |
| ': no in-situ rename', |
| ' does not hold (', |
| not(($InverseMode)), ')')"/> |
| </xsl:message> |
| </xsl:when> |
| <xsl:when test="$InverseMode"/> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="$InverseMode |
| or |
| self::comment()"> |
| |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:param name="Source"/> |
| <xsl:param name="InverseMode" select="false()"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InverseMode" select="$InverseMode"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| <xsl:variable name="EnclosingTag" select="../.."/> |
| |
| <xsl:if test="( |
| $InverseMode |
| and |
| ( |
| $InnerSimulation |
| or |
| normalize-space($InnerPass) |
| != string($InnerPass) |
| ) |
| ) |
| or |
| not($InverseMode)"> |
| <xsl:if test="$InverseMode |
| and |
| $InnerSimulation"> |
| <xsl:call-template name="cibtr:HelperDenormalizedSpace"> |
| <xsl:with-param name="Source" select="$InnerPass"/> |
| <xsl:with-param name="ResultTreeFragment" select="true()"/> |
| </xsl:call-template> |
| </xsl:if> |
| |
| |
| |
| |
| <xsl:variable name="ParentName"> |
| <xsl:choose> |
| <xsl:when test="not($InverseMode)"> |
| <xsl:value-of select="name()"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="'nvpair'"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:variable> |
| <xsl:element name="{$ParentName}"> |
| |
| <xsl:for-each select="@*"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapResourcesOperation/cibtr:replace[ |
| @what = name(current()) |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/../@name, '|')) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not( |
| $cibtr:MapResourcesOperation/cibtr:replace[ |
| @what = name(current()) |
| and |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current()/../@name, '|')) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:if test="$InnerPass = 'TRIGGER-MSG'"> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" |
| select="concat(../@id, |
| ' (rsc=', $EnclosingTag/@id, |
| ')')"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:choose> |
| |
| |
| <xsl:when test="$InverseMode |
| and |
| $Replacement/@where = 'meta_attributes' |
| and |
| not( |
| $EnclosingTag/meta_attributes[ |
| not(rule) |
| and |
| nvpair/@name = $Replacement/@with |
| ] |
| )"> |
| |
| |
| |
| <xsl:variable name="SimulateFollowingSiblings"> |
| <xsl:for-each select="../following-sibling::op"> |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| <xsl:if test="not(contains($SimulateFollowingSiblings, |
| concat(name(), ' ')))"> |
| |
| |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| |
| <xsl:value-of select="concat(name(), ' ')"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:attribute name="id"> |
| <xsl:value-of select="concat('_2TO3_', ../@id, '-meta-', |
| $Replacement/@with)"/> |
| </xsl:attribute> |
| <xsl:attribute name="name"> |
| <xsl:value-of select="$Replacement/@with"/> |
| </xsl:attribute> |
| <xsl:attribute name="value"> |
| <xsl:value-of select="."/> |
| </xsl:attribute> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="$InverseMode"/> |
| <xsl:when test="$Replacement |
| and |
| ( |
| not(string($Replacement/@with)) |
| or |
| $Replacement/@where |
| )"> |
| |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| <xsl:message terminate="yes"> |
| <xsl:value-of select="concat('INTERNAL ERROR: ', |
| $Replacement/../@msg-prefix, |
| ': no in-situ rename', |
| ' does not hold')"/> |
| </xsl:message> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| |
| <xsl:if test="not($InverseMode)"> |
| |
| |
| <xsl:variable name="ProcessedInverseNonruleOpInstanceAttributes"> |
| <xsl:for-each select="instance_attributes[not(rule)]"> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerPass" |
| select="substring-after( |
| concat( |
| string($InnerSimulation), |
| 'TRIGGER-MSG' |
| ), |
| 'true' |
| )"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| |
| <xsl:for-each select="$Source/node()"> |
| <xsl:choose> |
| <xsl:when test="self::text()"> |
| |
| <xsl:choose> |
| <xsl:when test="normalize-space($InnerPass) |
| != $InnerPass |
| and |
| ( |
| not(following-sibling::nvpair) |
| or |
| generate-id(following-sibling::nvpair[1]) |
| != generate-id(following-sibling::*[1]) |
| )"> |
| <xsl:value-of select="."/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="normalize-space(.)"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:when> |
| <xsl:when test="self::instance_attributes"> |
| <xsl:variable name="ProcessedOpInstanceAttributes"> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| <xsl:if test="normalize-space($ProcessedOpInstanceAttributes) |
| != $ProcessedOpInstanceAttributes"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedOpInstanceAttributes"/> |
| </xsl:call-template> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="self::meta_attributes"> |
| <xsl:variable name="ProcessedOpMetaAttributes"> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" |
| select="substring-after( |
| concat( |
| string($InnerSimulation), |
| 'TRIGGER-MSG' |
| ), |
| 'true' |
| )"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| |
| |
| |
| <xsl:if test="normalize-space($ProcessedOpMetaAttributes) |
| != $ProcessedOpMetaAttributes |
| or |
| ( |
| not(rule) |
| and |
| not(preceding-sibling::meta_attributes[not(rule)]) |
| and |
| normalize-space($ProcessedInverseNonruleOpInstanceAttributes) |
| != $ProcessedInverseNonruleOpInstanceAttributes |
| )"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| <xsl:if test="normalize-space($ProcessedOpMetaAttributes) |
| != $ProcessedOpMetaAttributes"> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedOpMetaAttributes"/> |
| </xsl:call-template> |
| </xsl:if> |
| <xsl:if test="not(rule) |
| and |
| not(preceding-sibling::meta_attributes[not(rule)]) |
| and |
| normalize-space($ProcessedInverseNonruleOpInstanceAttributes) |
| != $ProcessedInverseNonruleOpInstanceAttributes"> |
| <xsl:for-each select="../instance_attributes[not(rule)]"> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:if> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| |
| |
| |
| <xsl:if test="not(meta_attributes[not(rule)]) |
| and |
| normalize-space($ProcessedInverseNonruleOpInstanceAttributes) |
| != $ProcessedInverseNonruleOpInstanceAttributes"> |
| <meta_attributes id="{concat('_2TO3_', @id, '-meta')}"> |
| <xsl:for-each select="instance_attributes[not(rule)]"> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </meta_attributes> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </xsl:if> |
| |
| |
| <xsl:for-each select="instance_attributes[rule]"> |
| <xsl:variable name="ProcessedInverseRuleOpInstanceAttributes"> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerPass" |
| select="substring-after( |
| concat( |
| string($InnerSimulation), |
| 'TRIGGER-MSG' |
| ), |
| 'true' |
| )"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| <xsl:if test="normalize-space($ProcessedInverseRuleOpInstanceAttributes) |
| != $ProcessedInverseRuleOpInstanceAttributes"> |
| <meta_attributes> |
| <xsl:apply-templates select="@*[ |
| name() != 'id' |
| ]" |
| mode="cibtr:main"/> |
| <xsl:attribute name='id'> |
| <xsl:value-of select="concat('_2TO3_', @id)"/> |
| </xsl:attribute> |
| <xsl:apply-templates select="node()[ |
| name() != 'nvpair' |
| ]" |
| mode="cibtr:main"/> |
| <xsl:call-template name="cibtr:ProcessOpInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedInverseRuleOpInstanceAttributes"/> |
| </xsl:call-template> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </meta_attributes> |
| </xsl:if> |
| </xsl:for-each> |
| </xsl:if> |
| </xsl:element> |
| </xsl:if> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:param name="Source"/> |
| <xsl:param name="Variant"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="Variant" select="$Variant"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| <xsl:choose> |
| <xsl:when test="$Source/*[name() = $Variant]/meta_attributes[ |
| not(rule) |
| ]"> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" |
| select="$Source/crm_config/cluster_property_set[ |
| not(rule) |
| ]"/> |
| <xsl:with-param name="InverseMode" |
| select="$Source/*[name() = $Variant]/meta_attributes[ |
| not(rule) |
| ]"/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" |
| select="$Source/crm_config/cluster_property_set[ |
| not(rule) |
| ]"/> |
| <xsl:with-param name="InverseMode" |
| select="$Variant"/> |
| <xsl:with-param name="InnerSimulation" select="$InnerSimulation"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template name="cibtr:ProcessDefaultsRuleClusterProperties"> |
| <xsl:param name="Source"/> |
| <xsl:param name="Variant"/> |
| <xsl:param name="InnerSimulation" select="false()"/> |
| <xsl:param name="InnerPass"> |
| <xsl:choose> |
| <xsl:when test="$InnerSimulation"> |
| <xsl:value-of select="''"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="Variant" select="$Variant"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:param> |
| |
| <xsl:for-each select="crm_config/cluster_property_set[ |
| rule |
| ]"> |
| <xsl:variable name="ProcessedPartial"> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InverseMode" select="$Variant"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> |
| </xsl:call-template> |
| </xsl:variable> |
| <xsl:if test="normalize-space($ProcessedPartial) |
| != $ProcessedPartial"> |
| <meta_attributes id="{concat('_2TO3_', @id)}"> |
| <xsl-copy-of select="rule"/> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" select="$Source"/> |
| <xsl:with-param name="InverseMode" select="$Variant"/> |
| </xsl:call-template> |
| </meta_attributes> |
| </xsl:if> |
| </xsl:for-each> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template match="cib" mode="cibtr:main"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| <xsl:attribute name="validate-with"> |
| <xsl:value-of select="concat('pacemaker-', $cibtr:cib-min-ver)"/> |
| </xsl:attribute> |
| <xsl:apply-templates select="node()" |
| mode="cibtr:main"/> |
| </xsl:copy> |
| </xsl:template> |
| |
| <xsl:template match="cluster_property_set" mode="cibtr:main"> |
| <xsl:variable name="ProcessedClusterProperties"> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> |
| </xsl:call-template> |
| </xsl:variable> |
| <xsl:if test="normalize-space($ProcessedClusterProperties) |
| != $ProcessedClusterProperties"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| <xsl:call-template name="cibtr:ProcessClusterProperties"> |
| <xsl:with-param name="Source" select="."/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedClusterProperties"/> |
| </xsl:call-template> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:template> |
| |
| <xsl:template match="rsc_colocation" mode="cibtr:main"> |
| <xsl:copy> |
| <xsl:for-each select="@*"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapConstraintsColocation/cibtr:replace[ |
| @what = name(current()) |
| ]"/> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" select="../@id"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| not(string($Replacement/@with))"> |
| |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| |
| <xsl:attribute name="{name()}"> |
| <xsl:value-of select="$Replacement/@with"/> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| <xsl:apply-templates select="node()" |
| mode="cibtr:main"/> |
| </xsl:copy> |
| </xsl:template> |
| |
| <xsl:template match="node" mode="cibtr:main"> |
| <xsl:copy> |
| <xsl:for-each select="@*"> |
| <xsl:variable name="Replacement" |
| select="$cibtr:MapClusterNode/cibtr:replace[ |
| @what = name(current()) |
| and |
| ( |
| ( |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current(), '|')) |
| ) |
| or |
| ( |
| not(@in-case-of) |
| and |
| not( |
| $cibtr:MapClusterNode/cibtr:replace[ |
| @what = name(current()) |
| and |
| @in-case-of |
| and |
| contains(concat('|', @in-case-of, '|'), |
| concat('|', current(), '|')) |
| ] |
| ) |
| ) |
| ) |
| ]"/> |
| <xsl:call-template name="cibtr:MapMsg"> |
| <xsl:with-param name="Context" select="concat(../@uname, ' (id=', ../@id, ')')"/> |
| <xsl:with-param name="Replacement" select="$Replacement"/> |
| </xsl:call-template> |
| <xsl:choose> |
| <xsl:when test="$Replacement |
| and |
| not(string($Replacement/@with))"> |
| |
| </xsl:when> |
| <xsl:when test="$Replacement"> |
| |
| <xsl:attribute name="{$Replacement/@with}"> |
| <xsl:choose> |
| <xsl:when test="$Replacement/@redefined-as"> |
| <xsl:value-of select="$Replacement/@redefined-as"/> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="."/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:attribute> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:copy/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| <xsl:apply-templates select="node()" |
| mode="cibtr:main"/> |
| </xsl:copy> |
| </xsl:template> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <xsl:template match="primitive|template" mode="cibtr:main"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| |
| <xsl:for-each select="node()"> |
| <xsl:choose> |
| <xsl:when test="self::operations"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| |
| <xsl:for-each select="node()"> |
| <xsl:choose> |
| <xsl:when test="self::op"> |
| |
| |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| </xsl:call-template> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| </xsl:copy> |
| </xsl:when> |
| <xsl:when test="self::instance_attributes"> |
| <xsl:variable name="ProcessedRscInstanceAttributes"> |
| <xsl:call-template name="cibtr:ProcessRscInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| <xsl:if test="normalize-space($ProcessedRscInstanceAttributes) |
| != $ProcessedRscInstanceAttributes"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| <xsl:call-template name="cibtr:ProcessRscInstanceAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedRscInstanceAttributes"/> |
| </xsl:call-template> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:when> |
| <xsl:when test="self::meta_attributes"> |
| <xsl:variable name="ProcessedRscMetaAttributes"> |
| <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| <xsl:if test="normalize-space($ProcessedRscMetaAttributes) |
| != $ProcessedRscMetaAttributes"> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| <xsl:call-template name="cibtr:ProcessRscMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedRscMetaAttributes"/> |
| </xsl:call-template> |
| </xsl:copy> |
| </xsl:if> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| |
| |
| |
| |
| <xsl:variable name="ToPropagateFromOp"> |
| <xsl:for-each select="operations/op"> |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| <xsl:with-param name="InnerPass" select="'TRIGGER-MSG'"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| </xsl:variable> |
| |
| <xsl:if test="normalize-space($ToPropagateFromOp) |
| != $ToPropagateFromOp"> |
| <meta_attributes id="{concat('_2TO3_', @id, '-meta')}"> |
| <xsl:for-each select="operations/op"> |
| <xsl:call-template name="cibtr:ProcessAttrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| </xsl:call-template> |
| </xsl:for-each> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </meta_attributes> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </xsl:if> |
| |
| |
| |
| <xsl:for-each select="operations/op/meta_attributes |
| |operations/op/instance_attributes"> |
| <xsl:variable name="ProcessedOpMetaAttributes"> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| <xsl:if test="normalize-space($ProcessedOpMetaAttributes) |
| != $ProcessedOpMetaAttributes"> |
| |
| <meta_attributes> |
| <xsl:apply-templates select="@*[ |
| name() != 'id' |
| ]" |
| mode="cibtr:main"/> |
| <xsl:attribute name='id'> |
| <xsl:value-of select="concat('_2TO3_', @id)"/> |
| </xsl:attribute> |
| <xsl:apply-templates select="node()[ |
| name() != 'nvpair' |
| ]" |
| mode="cibtr:main"/> |
| <xsl:call-template name="cibtr:ProcessNonattrOpMetaAttributes"> |
| <xsl:with-param name="Source" select="."/> |
| <xsl:with-param name="InverseMode" select="true()"/> |
| |
| <xsl:with-param name="InnerPass" select="$ProcessedOpMetaAttributes"/> |
| </xsl:call-template> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </meta_attributes> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </xsl:if> |
| </xsl:for-each> |
| </xsl:copy> |
| </xsl:template> |
| |
| <xsl:template match="configuration" mode="cibtr:main"> |
| <xsl:variable name="Configuration" select="."/> |
| <xsl:variable name="ProcessedOpDefaultsNonruleClusterProperties"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'op_defaults'"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:variable> |
| <xsl:variable name="ProcessedRscDefaultsNonruleClusterProperties"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'rsc_defaults'"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:variable> |
| <xsl:variable name="ProcessedOpDefaultsRuleClusterProperties"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'op_defaults'"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:variable> |
| <xsl:variable name="ProcessedRscDefaultsRuleClusterProperties"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'rsc_defaults'"/> |
| <xsl:with-param name="InnerSimulation" select="true()"/> |
| </xsl:call-template> |
| </xsl:variable> |
| |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| |
| <xsl:for-each select="node()"> |
| <xsl:choose> |
| <xsl:when test="self::op_defaults|self::rsc_defaults"> |
| <xsl:variable name="WhichDefaults" select="name()"/> |
| <xsl:copy> |
| <xsl:apply-templates select="@*" |
| mode="cibtr:main"/> |
| |
| <xsl:for-each select="node()"> |
| <xsl:copy> |
| <xsl:choose> |
| <xsl:when test="self::meta_attributes[ |
| not(rule) |
| and |
| not( |
| preceding-sibling::meta_attributes[ |
| not(rule) |
| ] |
| ) |
| ]"> |
| <xsl:apply-templates select="@*|node()" |
| mode="cibtr:main"/> |
| <xsl:if test="$WhichDefaults = 'op_defaults' |
| or |
| $WhichDefaults = 'rsc_defaults'"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="$WhichDefaults"/> |
| </xsl:call-template> |
| </xsl:if> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:apply-templates select="@*|node()" |
| mode="cibtr:main"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| <xsl:if test="( |
| $WhichDefaults = 'op_defaults' |
| and |
| normalize-space($ProcessedOpDefaultsRuleClusterProperties) |
| != $ProcessedOpDefaultsRuleClusterProperties |
| ) |
| or |
| ( |
| $WhichDefaults = 'rsc_defaults' |
| and |
| normalize-space($ProcessedRscDefaultsRuleClusterProperties) |
| != $ProcessedRscDefaultsRuleClusterProperties |
| )"> |
| <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="$WhichDefaults"/> |
| </xsl:call-template> |
| </xsl:if> |
| </xsl:copy> |
| </xsl:for-each> |
| |
| </xsl:copy> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| |
| <xsl:if test="not(op_defaults) |
| and |
| ( |
| normalize-space($ProcessedOpDefaultsNonruleClusterProperties) |
| != $ProcessedOpDefaultsNonruleClusterProperties |
| or |
| normalize-space($ProcessedOpDefaultsRuleClusterProperties) |
| != $ProcessedOpDefaultsRuleClusterProperties |
| )"> |
| <op_defaults> |
| <xsl:if test="normalize-space($ProcessedOpDefaultsNonruleClusterProperties) |
| != $ProcessedOpDefaultsNonruleClusterProperties"> |
| <meta_attributes id="{concat('_2TO3_', '-op-defaults')}"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'op_defaults'"/> |
| </xsl:call-template> |
| </meta_attributes> |
| </xsl:if> |
| <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'op_defaults'"/> |
| </xsl:call-template> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </op_defaults> |
| </xsl:if> |
| <xsl:if test="not(rsc_defaults) |
| and |
| ( |
| normalize-space($ProcessedRscDefaultsNonruleClusterProperties) |
| != $ProcessedRscDefaultsNonruleClusterProperties |
| or |
| normalize-space($ProcessedRscDefaultsRuleClusterProperties) |
| != $ProcessedRscDefaultsRuleClusterProperties |
| )"> |
| <rsc_defaults> |
| <xsl:if test="normalize-space($ProcessedRscDefaultsNonruleClusterProperties) |
| != $ProcessedRscDefaultsNonruleClusterProperties"> |
| <meta_attributes id="{concat('_2TO3_', '-rsc-defaults')}"> |
| <xsl:call-template name="cibtr:ProcessDefaultsNonruleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'rsc_defaults'"/> |
| </xsl:call-template> |
| </meta_attributes> |
| </xsl:if> |
| <xsl:call-template name="cibtr:ProcessDefaultsRuleClusterProperties"> |
| <xsl:with-param name="Source" select="$Configuration"/> |
| <xsl:with-param name="Variant" select="'rsc_defaults'"/> |
| </xsl:call-template> |
| <xsl:apply-templates select="text()[position() = last()]" |
| mode="cibtr:main"/> |
| </rsc_defaults> |
| </xsl:if> |
| </xsl:copy> |
| </xsl:template> |
| |
| |
| <xsl:template match="processing-instruction()[ |
| name() = 'xml-stylesheet' |
| and |
| count(..|/) = 1 |
| ]" |
| mode="cibtr:main"/> |
| |
| <xsl:template match="@*|node()" mode="cibtr:main"> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:template> |
| |
| |
| <xsl:template match="/"> |
| <xsl:call-template name="cibtr:HelperIdentity"/> |
| </xsl:template> |
| |
| </xsl:stylesheet> |