Khyros12
Khyros12

Reputation: 1

XML Parser skips end tag after Saxon upgrade from 10.6 to 11.3

I use xslt-saxon to transform xml file. XML parser works complitly fine on Saxon 10.6 but after upgrade to Saxon-HE 11.4 it skips closing tags and read another tags as input. It only occurs if there are only spaces in between tag. If there is any letters or nothing it works fine.

<Tag0>
  <Tag1>sample1</Tag1>
  <Tag2>  </Tag2>
  <Tag3>sample2</Tag3>
</Tag0>

ends as

<Tag0 Tag1="sample1"
Tag2="   &lt;Tag2>&#xa;  &lt;Tag3>sample2&lt;/Tag2>&#xa;"/>

xslt file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
    version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:fn="http://www.w3.org/2005/xpath-functions" 
    >
   
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">
        <xsl:element name="{MsgStr}message" namespace="{$msgNamespace}">
            <xsl:element name="Tag1"  namespace="{$Namespace}">
                <xsl:attribute name="Tag2"><xsl:value-of select="*:Tag2"/></xsl:attribute>
                <xsl:attribute name="Tag3"><xsl:value-of select="*:Tag3"/></xsl:attribute>
            </xsl:element>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

I tried put *:Tag2/text() but without any results.

Upvotes: 0

Views: 116

Answers (1)

Michael Kay
Michael Kay

Reputation: 163488

This is very strange behaviour, and it's not really possible to investigate it without a complete repro. Your example is clearly incomplete: the stylesheet contains undeclared variables, etc. I suspect a Saxon bug, if only a failure to detect and report something you are doing wrong. Please try to put together a repro (that is, everything needed for someone else to reproduce the effect) and post it at saxonica.plan.io.

Upvotes: 0

Related Questions