<commit_before><xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:d="urn:jboss:domain:1.2">

    <!--
        An XSLT style sheet which will add a port offset to a standalone-ha.xml config.
        This is done by changing:
        <server>
          ...
          <management>
            <management-interfaces>
          <native-interface interface="management" port="$nativeInterfaceManagementPort"/>
          <http-interface interface="management" port="$nativeInterfaceManagementPort"/>
        </management-interfaces>
          </management>
      ...
          <socket-binding-group name="standard-sockets" default-interface="public" port-offset="$portOffset">
      ...
        </server>
    -->

    <!-- port changes -->
    <xsl:param name="portOffset" select="'100'"/>
    <xsl:param name="nativeInterfaceManagementPort" select="'9999'"/>
    <xsl:param name="httpInterfaceManagementPort" select="'9990'"/>

    <!-- traverse the whole tree, so that all elements and attributes are eventually current node -->
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

    <!-- change the native interface management port -->
    <xsl:template match="//d:socket-binding-group/d:socket-binding[@name='management-native']">
        <xsl:copy>
            <xsl:attribute name="name">
                <xsl:value-of select="@name"/>
            </xsl:attribute>
            <xsl:attribute name="interface">
                <xsl:value-of select="@interface"/>
            </xsl:attribute>
            <xsl:attribute name="port">
                <xsl:value-of select="$nativeInterfaceManagementPort"/>
            </xsl:attribute>
        </xsl:copy>
    </xsl:template>

    <!-- change the HTTP interface management port -->
    <xsl:template match="//d:socket-binding-group/d:socket-binding[@name='management-http']">
        <xsl:copy>
            <xsl:attribute name="name">
                <xsl:value-of select="@name"/>
            </xsl:attribute>
            <xsl:attribute name="interface">
                <xsl:value-of select="@interface"/>
            </xsl:attribute>
            <xsl:attribute name="port">
                <xsl:value-of select="$httpInterfaceManagementPort"/>
            </xsl:attribute>
        </xsl:copy>
    </xsl:template>

    <!-- add the port offset -->
    <xsl:template match="//d:socket-binding-group[@name='standard-sockets']">
        <xsl:copy>
            <xsl:attribute name="name">
                <xsl:value-of select="'standard-sockets'"/>
            </xsl:attribute>
            <xsl:attribute name="default-interface">
                <xsl:value-of select="'public'"/>
            </xsl:attribute>
            <xsl:attribute name="port-offset">
                <xsl:value-of select="$portOffset"/>
            </xsl:attribute>
            <xsl:apply-templates select="node()"/>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet><commit_msg>Simplified XSLT.<commit_after><xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:d="urn:jboss:domain:1.2">

    <!--
        An XSLT style sheet which will add a port offset to a standalone-ha.xml config.
        This is done by changing:
        <server>
          ...
          <management>
            <management-interfaces>
          <native-interface interface="management" port="$nativeInterfaceManagementPort"/>
          <http-interface interface="management" port="$nativeInterfaceManagementPort"/>
        </management-interfaces>
          </management>
      ...
          <socket-binding-group name="standard-sockets" default-interface="public" port-offset="$portOffset">
      ...
        </server>
    -->

    <!-- Template parameters and default values. -->
    <xsl:param name="portOffset" select="'100'"/>
    <xsl:param name="nativeInterfaceManagementPort" select="'9999'"/>
    <xsl:param name="httpInterfaceManagementPort" select="'9990'"/>

    <!-- Set the native management port. -->
    <xsl:template match="//d:socket-binding-group/d:socket-binding[@name='management-native']/@port">
        <xsl:attribute name="port">${jboss.management.native.port:<xsl:value-of select="$nativeInterfaceManagementPort"/>}</xsl:attribute>
    </xsl:template>

    <!-- Set the HTTP management port. -->
    <xsl:template match="//d:socket-binding-group/d:socket-binding[@name='management-http']/@port">
        <xsl:attribute name="port">
            <xsl:value-of select="$httpInterfaceManagementPort"/>
        </xsl:attribute>
    </xsl:template>

    <!-- Set the port offset. -->
    <xsl:template match="//d:socket-binding-group[@name='standard-sockets']/@port-offset">
        <xsl:attribute name="port-offset">
            <xsl:value-of select="$portOffset"/>
        </xsl:attribute>
    </xsl:template>

    <!-- Copy everything else -->
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.16676350958744915, 'fraction_numerical': 0.007747433662599264, 'mean_word_length': 2.3862295081967213, 'pattern_counts': {'":': 0, '<': 108, '<?xml version=': 0, '>': 108, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3134739', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1383, 'n_words': 250}