<commit_before><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:fsd="http://www.convx.org/schemas/1.0/fsd">

    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">
        <xs:schema>
            <xsl:apply-templates/>
        </xs:schema>
    </xsl:template>

    <xsl:template match="/fsd:schema/fsd:root | //fsd:sequence" priority="1">
        <xs:element name="{@name}">
            <xsl:if test="@maxOccurs">
                <xsl:attribute name="maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:attribute>
            </xsl:if>
            <xs:complexType>
                <xs:sequence>
                    <xsl:apply-templates/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xsl:template>

    <xsl:template match="//fsd:sequence[not(child::node()[@name])]" priority="2">
        <xsl:variable name="fieldNode" select="fsd:delimitedField | fsd:fixedField"/>
        <xsl:choose>
            <xsl:when test="$fieldNode/@ref">
                <xs:element name="{@name}" type="{$fieldNode/@ref}"/>
            </xsl:when>
            <xsl:otherwise>
                <xs:element name="{@name}" type="xs:string"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template match="//fsd:element[@name]">
        <xs:element name="{@name}" type="{@ref}"/>
    </xsl:template>

    <xsl:template match="/fsd:schema/fsd:fixedField[@id] | /fsd:schema/fsd:delimitedField[@id]">
        <xs:simpleType name="{@id}">
            <xs:restriction base="xs:string">
            </xs:restriction>
        </xs:simpleType>
    </xsl:template>

    <xsl:template match="/fsd:schema/fsd:root//fsd:fixedField | /fsd:schema/fsd:root//fsd:delimitedField">
        <xs:element name="{@name}" type="xs:string"/>
    </xsl:template>

</xsl:stylesheet><commit_msg>Added "character sets" and merged delimited/fixed fields into one.<commit_after><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:fsd="http://www.convx.org/schemas/1.0/fsd">

    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">
        <xs:schema>
            <xsl:apply-templates/>
        </xs:schema>
    </xsl:template>

    <xsl:template match="/fsd:schema/fsd:root | //fsd:sequence" priority="1">
        <xs:element name="{@name}">
            <xsl:if test="@maxOccurs">
                <xsl:attribute name="maxOccurs"><xsl:value-of select="@maxOccurs"/></xsl:attribute>
            </xsl:if>
            <xs:complexType>
                <xs:sequence>
                    <xsl:apply-templates/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xsl:template>

    <xsl:template match="//fsd:sequence[not(child::node()[@name])]" priority="2">
        <xsl:variable name="fieldNode" select="fsd:field"/>
        <xsl:choose>
            <xsl:when test="$fieldNode/@ref">
                <xs:element name="{@name}" type="{$fieldNode/@ref}"/>
            </xsl:when>
            <xsl:otherwise>
                <xs:element name="{@name}" type="xs:string"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template match="//fsd:element[@name]">
        <xs:element name="{@name}" type="{@ref}"/>
    </xsl:template>

    <xsl:template match="/fsd:schema/fsd:field[@id]">
        <xs:simpleType name="{@id}">
            <xs:restriction base="xs:string">
            </xs:restriction>
        </xs:simpleType>
    </xsl:template>

    <xsl:template match="/fsd:schema/fsd:root//fsd:field">
        <xs:element name="{@name}" type="xs:string"/>
    </xsl:template>

</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.19863373620599054, 'fraction_numerical': 0.008407777193904361, 'mean_word_length': 2.4514959202175883, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 8}, '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': '2472541', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1210, 'n_words': 160}