<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright 2009-2015 European Molecular Biology Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:fn="http://www.w3.org/2005/xpath-functions"
                xmlns:ae="http://www.ebi.ac.uk/arrayexpress/XSLT/Extension"
                xmlns:search="http://www.ebi.ac.uk/arrayexpress/XSLT/SearchExtension"
                extension-element-prefixes="xs fn ae search"
                exclude-result-prefixes="xs fn ae search"
                version="2.0">

    <xsl:param name="sortby"/>
    <xsl:param name="sortorder"/>

    <xsl:variable name="vSortBy" select="if ($sortby) then $sortby else 'releasedate'"/>
    <xsl:variable name="vSortOrder" select="if ($sortorder) then $sortorder else 'descending'"/>

    <xsl:param name="queryid"/>

    <xsl:param name="host"/>
    <xsl:param name="context-path"/>


    <xsl:variable name="vBaseUrl"><xsl:value-of select="$host"/><xsl:value-of select="$context-path"/></xsl:variable>
    <xsl:output omit-xml-declaration="no" method="xml" indent="no" encoding="UTF-8"/>

    <xsl:include href="ae-sort-files.xsl"/>

    <xsl:template name="root">
        <xsl:param name="pJson" as="xs:boolean"/>

        <xsl:variable name="vFilteredFiles" select="search:queryIndex($queryid)"/>
        <xsl:variable name="vTotal" select="count($vFilteredFiles)"/>

        <files api-version="3" api-revision="091015" version="1.0" revision="091015"
                   total-protocols="{$vTotal}">
            <xsl:call-template name="ae-sort-files">
                <xsl:with-param name="pFiles" select="$vFilteredFiles"/>
                <xsl:with-param name="pFrom"/>
                <xsl:with-param name="pTo"/>
                <xsl:with-param name="pSortBy" select="$vSortBy"/>
                <xsl:with-param name="pSortOrder" select="$vSortOrder"/>
            </xsl:call-template>
        </files>
    </xsl:template>

    <xsl:template match="file">
        <file>
            <xsl:apply-templates select="*" mode="copy"/>
        </file>
    </xsl:template>

    <xsl:template match="source | user" mode="copy"/>

    <xsl:template match="*" mode="copy">
        <xsl:copy-of select="."/>
    </xsl:template>
</xsl:stylesheet><commit_msg>- updated file API<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright 2009-2015 European Molecular Biology Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:fn="http://www.w3.org/2005/xpath-functions"
                xmlns:ae="http://www.ebi.ac.uk/arrayexpress/XSLT/Extension"
                xmlns:search="http://www.ebi.ac.uk/arrayexpress/XSLT/SearchExtension"
                extension-element-prefixes="xs fn ae search"
                exclude-result-prefixes="xs fn ae search"
                version="2.0">

    <xsl:param name="sortby"/>
    <xsl:param name="sortorder"/>

    <xsl:variable name="vSortBy" select="if ($sortby) then $sortby else 'releasedate'"/>
    <xsl:variable name="vSortOrder" select="if ($sortorder) then $sortorder else 'descending'"/>

    <xsl:param name="queryid"/>

    <xsl:param name="host"/>
    <xsl:param name="context-path"/>


    <xsl:variable name="vBaseUrl"><xsl:value-of select="$host"/><xsl:value-of select="$context-path"/></xsl:variable>
    <xsl:output omit-xml-declaration="no" method="xml" indent="no" encoding="UTF-8"/>

    <xsl:include href="ae-sort-files.xsl"/>

    <xsl:template name="root">
        <xsl:param name="pJson" as="xs:boolean"/>

        <xsl:variable name="vFilteredFiles" select="search:queryIndex($queryid)"/>
        <xsl:variable name="vTotal" select="count($vFilteredFiles)"/>

        <files api-version="3" api-revision="091015" version="1.0" revision="091015"
                   total-files="{$vTotal}">
            <xsl:call-template name="ae-sort-files">
                <xsl:with-param name="pFiles" select="$vFilteredFiles"/>
                <xsl:with-param name="pFrom"/>
                <xsl:with-param name="pTo"/>
                <xsl:with-param name="pSortBy" select="$vSortBy"/>
                <xsl:with-param name="pSortOrder" select="$vSortOrder"/>
            </xsl:call-template>
        </files>
    </xsl:template>

    <xsl:template match="file">
        <file>
            <xsl:apply-templates select="@*" mode="copy"/>
        </file>
    </xsl:template>

    <xsl:template match="@access | @owner | @group | @hidden" mode="copy"/>

    <xsl:template match="@location" mode="copy">
        <xsl:element name="url">
            <xsl:value-of select="$vBaseUrl"/>/files/<xsl:value-of select="../../@accession"/>/<xsl:value-of select="../@name"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="@*" mode="copy">
        <xsl:element name="{fn:lower-case(fn:name())}">
            <xsl:value-of select="." />
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.1670169765561843, 'fraction_numerical': 0.015521422797089733, 'mean_word_length': 2.94263862332696, 'pattern_counts': {'":': 0, '<': 92, '<?xml version=': 2, '>': 92, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 16}, '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': '377669', 'n_tokens_mistral': 2036, 'n_tokens_neox': 1835, 'n_words': 404}