github.com/matislovas/ratago@v0.0.0-20240408115641-cc0857415a7a/xslt/testdata/general/bug-146.xsl (about)

     1  <?xml version="1.0" encoding="windows-1251"?>
     2  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     3  <xsl:output method="xml" encoding="windows-1251" indent="yes"/>
     4  <xsl:strip-space elements="*"/>
     5  <xsl:key name="EMPTY_EN_CODE_COLLS" match="/root/colls/goodcoll/goodcomb/@COL_ID
     6  [../@EN_CODE = '']" use="../../../@COL_COD"/>
     7  <xsl:key name="EMPTY_EN_CODE_COLRS" match="/root/colls/goodcoll/goodcomb/@COL_ID
     8  [../@EN_CODE = '']" use="concat(.,':',../../../@COL_COD)"/>
     9  <xsl:template match="/">
    10  <root>
    11   <xsl:for-each select="/root/colls[key('EMPTY_EN_CODE_COLLS',@COL_COD)]">
    12    <xsl:copy>
    13     <xsl:copy-of select="@*"/>
    14     <xsl:for-each select="key('EMPTY_EN_CODE_COLLS',@COL_COD)[generate-id(.) = 
    15  generate-id(key('EMPTY_EN_CODE_COLRS',concat(.,':',../../../@COL_COD)))]">
    16      <color>
    17       <xsl:copy-of select="../@TITLE | ../@RU_CODE | ."/>
    18      </color>
    19     </xsl:for-each>
    20    </xsl:copy>
    21   </xsl:for-each>
    22  </root>
    23  </xsl:template>
    24  </xsl:stylesheet>