<commit_before><?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <sch:ns uri="http://doctales.github.io" prefix="doctales"/>
    <sch:extends href="terminology.sch"/>
    
    <sch:title>Style Guide for Termentry Maps</sch:title>
    
    <sch:pattern id="validate-topicref">
        <sch:rule context="*[contains(@class, ' map/topicref ')][not(contains(@format, 'ditamap'))]">
            <sch:let name="key" value="doctales:getIdFromPath(@href)"/>
            <sch:assert test="contains(@keys, $key)" sqf:fix="fix-id" role="warning"
                diagnostics="validate-topicref-en validate-topicref-de">
                The key of a topicref should contain the filename of the termentry topic without file extension.
            </sch:assert>
            <sch:let name="new-keys" value="concat(concat(@keys, ' '), $key)"/>
            <sqf:fix id="fix-id">
                <sqf:description>
                    <sqf:title>Rename keys to '<sch:value-of select="$new-keys"/>'</sqf:title>
                </sqf:description>
                <sqf:add node-type="attribute" target="keys"><sch:value-of select="$new-keys"/></sqf:add>
            </sqf:fix>
        </sch:rule>
    </sch:pattern>
    <sch:diagnostics>
        <sch:diagnostic id="validate-topicref-en" xml:lang="en"><commit_msg>Fix Schematron rule to match <termref> elements<commit_after><?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <sch:ns uri="http://doctales.github.io" prefix="doctales"/>
    <sch:extends href="terminology.sch"/>
    
    <sch:title>Style Guide for Termentry Maps</sch:title>
    
    <sch:pattern id="validate-topicref">
        <sch:rule context="*[contains(@class, ' termmap/termref ')]">
            <sch:let name="key" value="doctales:getIdFromPath(@href)"/>
            <sch:assert test="contains(@keys, $key)" sqf:fix="fix-id" role="warning"
                diagnostics="validate-topicref-en validate-topicref-de">
                The key of a topicref should contain the filename of the termentry topic without file extension.
            </sch:assert>
            <sch:let name="new-keys" value="concat(concat(@keys, ' '), $key)"/>
            <sqf:fix id="fix-id">
                <sqf:description>
                    <sqf:title>Rename keys to '<sch:value-of select="$new-keys"/>'</sqf:title>
                </sqf:description>
                <sqf:add node-type="attribute" target="keys"><sch:value-of select="$new-keys"/></sqf:add>
            </sqf:fix>
        </sch:rule>
    </sch:pattern>
    <sch:diagnostics>
        <sch:diagnostic id="validate-topicref-en" xml:lang="en">
{'fraction_non_alphanumeric': 0.17785234899328858, 'fraction_numerical': 0.006040268456375839, 'mean_word_length': 2.953580901856764, 'pattern_counts': {'":': 0, '<': 56, '<?xml version=': 2, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 10}, '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': '7290879', 'n_tokens_mistral': 990, 'n_tokens_neox': 967, 'n_words': 155}