<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:str="http://exslt.org/strings">
  <xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="/">
  <l><xsl:text>&#10;</xsl:text>
  <xsl:apply-templates select="//*[*[not(self::col)]/@translatable='yes']" />
  <xsl:apply-templates select="interface/object[data/row/col[@id='0'][@translatable='yes']]" />
  </l>
</xsl:template>

<xsl:template match="*/*[not(self::col)][@translatable]">
  <xsl:text> </xsl:text>
  <t r="string" g="{str:tokenize(../@id,':')[1]}" l="{@name}">
  <xsl:copy-of select="text()" />
  </t><xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="col[@id='0']">
  <xsl:text> </xsl:text><commit_msg>Resolves: fdo#57107 processing translatable child nodes twice<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:str="http://exslt.org/strings">
  <xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="/">
  <l><xsl:text>&#10;</xsl:text>
  <!--
      What I want to do here is to extract all nodes that are translatable
      except the columns of list and tree stores
  -->
  <xsl:apply-templates select="//*[not(self::col)][@translatable='yes']" />
  <!--
      What I want to do here is to extract just the list and tree store
      columns that that are translatable
  -->
  <xsl:apply-templates select="interface/object[data/row/col[@id='0'][@translatable='yes']]" />
  </l>
</xsl:template>

<!--
    Normal nodes
-->
<xsl:template match="*/*[not(self::col)][@translatable='yes']">
  <xsl:text> </xsl:text>
  <t r="string" g="{str:tokenize(../@id,':')[1]}" l="{@name}">
  <xsl:copy-of select="text()" />
  </t><xsl:text>&#10;</xsl:text>
</xsl:template>

<!--
    Column nodes
-->
<xsl:template match="col[@id='0'][@translatable='yes']">
  <xsl:text> </xsl:text>
{'fraction_non_alphanumeric': 0.22352465642683914, 'fraction_numerical': 0.019805982215036377, 'mean_word_length': 4.3111587982832615, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 2, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2734324', 'n_tokens_mistral': 959, 'n_tokens_neox': 880, 'n_words': 205}