<commit_before><?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:ro="http://ands.org.au/standards/rif-cs/registryObjects" xmlns:extRif="http://ands.org.au/standards/rif-cs/extendedRegistryObjects" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="ro extRif">

    <xsl:output omit-xml-declaration="yes" indent="yes" />
    <xsl:strip-space elements="*"/>
    <xsl:output method="xml" encoding="UTF-8" />
    <xsl:param name="recordCreatedDate" />
    <xsl:param name="recordUpdatedDate" />
    <xsl:param name="boost" select="1" />

<xsl:template match="/">
    <xsl:apply-templates/>
</xsl:template>   
    
 <xsl:template match="ro:registryObjects">
    <xsl:apply-templates select="ro:registryObject"/>
 </xsl:template> 

    <xsl:template match="ro:registryObject">
    

        <doc boost="{$boost}">
        <xsl:variable name="roKey">
            <xsl:apply-templates select="ro:key"/>
        </xsl:variable>
        <xsl:choose>
            <xsl:when test="extRif:extendedMetadata">
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:slug"/>
                <xsl:element name="field">
                    <xsl:attribute name="name">key</xsl:attribute>
                    <xsl:value-of select="ro:key"/>
                </xsl:element>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:dataSourceKey"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:status"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:logo"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:matching_identifier_count"/>
                <xsl:apply-templates select="ro:originatingSource"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:id"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:dataSourceID"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:contributor"/>

                <xsl:element name="field">
                    <xsl:attribute name="name">record_created_timestamp</xsl:attribute>
                    <xsl:value-of select="$recordCreatedDate"/>
                </xsl:element> 
                <xsl:element name="field">
                    <xsl:attribute name="name">record_modified_timestamp</xsl:attribute>
                    <xsl:value-of select="$recordUpdatedDate"/>
                </xsl:element>    
                <!--xsl:apply-templates select="extRif:extendedMetadata/extRif:updateTimestamp"/-->

                <xsl:element name="field">
                    <xsl:attribute name="name">group</xsl:attribute>
                    <xsl:value-of select="@group"/>
                </xsl:element><commit_msg>fix: matching identifier count appears twice in extrif to solr<commit_after><?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:ro="http://ands.org.au/standards/rif-cs/registryObjects" xmlns:extRif="http://ands.org.au/standards/rif-cs/extendedRegistryObjects" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="ro extRif">

    <xsl:output omit-xml-declaration="yes" indent="yes" />
    <xsl:strip-space elements="*"/>
    <xsl:output method="xml" encoding="UTF-8" />
    <xsl:param name="recordCreatedDate" />
    <xsl:param name="recordUpdatedDate" />
    <xsl:param name="boost" select="1" />

<xsl:template match="/">
    <xsl:apply-templates/>
</xsl:template>   
    
 <xsl:template match="ro:registryObjects">
    <xsl:apply-templates select="ro:registryObject"/>
 </xsl:template> 

    <xsl:template match="ro:registryObject">
    

        <doc boost="{$boost}">
        <xsl:variable name="roKey">
            <xsl:apply-templates select="ro:key"/>
        </xsl:variable>
        <xsl:choose>
            <xsl:when test="extRif:extendedMetadata">
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:slug"/>
                <xsl:element name="field">
                    <xsl:attribute name="name">key</xsl:attribute>
                    <xsl:value-of select="ro:key"/>
                </xsl:element>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:dataSourceKey"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:status"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:logo"/>
                <xsl:apply-templates select="ro:originatingSource"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:id"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:dataSourceID"/>
                <xsl:apply-templates select="extRif:extendedMetadata/extRif:contributor"/>

                <xsl:element name="field">
                    <xsl:attribute name="name">record_created_timestamp</xsl:attribute>
                    <xsl:value-of select="$recordCreatedDate"/>
                </xsl:element> 
                <xsl:element name="field">
                    <xsl:attribute name="name">record_modified_timestamp</xsl:attribute>
                    <xsl:value-of select="$recordUpdatedDate"/>
                </xsl:element>    
                <!--xsl:apply-templates select="extRif:extendedMetadata/extRif:updateTimestamp"/-->

                <xsl:element name="field">
                    <xsl:attribute name="name">group</xsl:attribute>
                    <xsl:value-of select="@group"/>
                </xsl:element>
{'fraction_non_alphanumeric': 0.1539855072463768, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 2.644224422442244, 'pattern_counts': {'":': 0, '<': 104, '<?xml version=': 2, '>': 104, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, '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': '6987817', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1528, 'n_words': 194}