code: def test_style_to_json(geom_df):
      pytest.importorskip("lxml")
      xsl = """\
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="text" indent="yes" />
      <xsl:strip-space elements="*"/>
  
      <xsl:param name="quot">"</xsl:param>
  
      <xsl:template match="/data">
          <xsl:text>{"shape":{</xsl:text>
          <xsl:apply-templates select="descendant::row/shape"/>
          <xsl:text>},"degrees":{</xsl:text>
          <xsl:apply-templates select="descendant::row/degrees"/>
          <xsl:text>},"sides":{</xsl:text>
          <xsl:apply-templates select="descendant::row/sides"/>
          <xsl:text>}}</xsl:text>
      </xsl:template>
  
      <xsl:template match="shape|degrees|sides">
          <xsl:variable name="val">
              <xsl:if test = ".=''">
                  <xsl:value-of select="'null'"/>
              </xsl:if>
              <xsl:if test = "number(text()) = text()">
                  <xsl:value-of select="text()"/>
              </xsl:if>
              <xsl:if test = "number(text()) != text()">
                  <xsl:value-of select="concat($quot, text(), $quot)"/>
              </xsl:if>
          </xsl:variable>
          <xsl:value-of select="concat($quot, preceding-sibling::index,
                                       $quot,':', $val)"/>
          <xsl:if test="preceding-sibling::index != //row[last()]/index">
              <xsl:text>,</xsl:text>
          </xsl:if>
      </xsl:template>
  </xsl:stylesheet>"""
  
      out_json = geom_df.to_json()
      out_xml = geom_df.to_xml(stylesheet=xsl)
  
      assert out_json == out_xml
  
imports: from __future__ import annotations
  from io import BytesIO, StringIO
  import os
  import numpy
  import pytest
  import pandas.util._test_decorators
  from pandas import NA, DataFrame, Index
  import pandas._testing
  from pandas.io.common import get_handle
  from pandas.io.xml import read_xml
label_desc: Use image node_id 54 for calling a global function with example usage: test_style_to_json(geom_df) without return types