[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Strange template behavior


Subject: [xsl] Strange template behavior
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Tue, 4 Sep 2012 06:33:12 -0700

I am using XSLT2 and the free version of Saxon 9. When I run this with simple input data and a simple stylesheet, it works, but in my very complex stylesheet dealing with a very large input, it fails in the first instance and succeeds in the second. I am baffled. Here is the story:

Below is a template. When it is called, it fails to terminate the element in the output XML and gives the error:

"Error on line 273 column 9 of 33Subjects.xml:
SXXP0003: Error reported by XML parser: The element type "Link" must be terminated by the matching end-tag "</Link>". Transformation failed: Run-time errors were reported"


But rename the element within this template and it works. Does the fact that the mode is called "link" have anything to do with its failure?

[I know I am not showing the data input and style sheet -- they are very, very large, but I swear the element name change is the only alteration I make to cause this.]

Mark

Failing scenario
Fails. Outputs: <Link dumb="what"> <!---No termination-->

<xsl:template match="Xref" mode="link">
   <Link>
     <xsl:attribute name="dumb" select="'what'"></xsl:attribute>
  </Link>
</xsl:template>

Successful scenario
Has no problem. Outputs:  <SomethingElse dumb="what"/> <!---Terminated-->

<xsl:template match="Xref" mode="link">
   <SomethingElse>
     <xsl:attribute name="dumb" select="'what'"></xsl:attribute>
  </SomethingElse>
</xsl:template>


Current Thread
Keywords
xml