DesignLiquido / xslt-processor

A JavaScript XSLT processor without native library dependencies
GNU Lesser General Public License v3.0
94 stars 30 forks source link

Unexpected output when transforming #74

Closed boozedog closed 8 months ago

boozedog commented 9 months ago

XML:

<?xml version="1.0" encoding="UTF-8"?>
<problem/>

XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/problem">
    <div>
      <div>
        <table>
          <tr>
            <th>A</th>
            <th>B</th>
            <th>C</th>
          </tr>
          <tr>
            <td>AA</td>
            <td>BB</td>
            <td>CC</td>
          </tr>
        </table>
      </div>
    </div>
    <div>
      <div>
        should be below table rite??!
      </div>
    </div>
  </xsl:template>
</xsl:stylesheet>

output (pretty-printed for legibility):

<div>
  <div>
    <table>
      <tr>
        <th>A</th>
        <th>B</th>
        <th>C</th>
      </tr>
      <tr>
        <td>AA</td>
        <td>BB</td>
        <div>CC<div>
            should be below table rite??!
          </div>
        </div>
      </tr>
    </table>
  </div>
</div>

Is there something wrong with my XSLT? Somehow the CC ends up in a <div> tag.

I'm using xslt-processor@2.0.0 on node@18.16.1

Thanks!

boozedog commented 9 months ago

Just tested with xslt-processor@1.2.8 and got same result.

boozedog commented 9 months ago

Hello??! Is there anybody out there :grimacing:

@leonelsanchesdasilva

leonelsanchesdasilva commented 9 months ago

Hi @boozedog. Thanks for reporting. In fact there are some issues with HTML that I didn't have the time to fix yet.

I should have time in two weeks to test the condition and publish a fix.

boozedog commented 9 months ago

@leonelsanchesdasilva understood, thank you

leonelsanchesdasilva commented 8 months ago

@boozedog Finally got to sit and resolve this. Here's the release: https://github.com/DesignLiquido/xslt-processor/releases/tag/v2.0.1