HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/langchain_text_splitters/xsl/converting_to_header.xslt
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!-- Copy all nodes and attributes by default -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- Match any element that has a font-size attribute larger than 20px -->
  <xsl:template match="*[@style[contains(., 'font-size')]]">
    <!-- Extract the font size value from the style attribute -->
    <xsl:variable name="font-size" select="substring-before(substring-after(@style, 'font-size:'), 'px')" />
    <!-- Check if the font size is larger than 20 -->
    <xsl:choose>
      <xsl:when test="$font-size > 20">
        <!-- Replace the element with a header tag -->
        <h1>
          <xsl:apply-templates select="@*|node()"/>
        </h1>
      </xsl:when>
      <xsl:otherwise>
        <!-- Keep the original element -->
        <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>