[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Strange template behavior

Subject: Re: Strange template behavior
From: Syd Bauman <Syd_Bauman@xxxxxxxxx>
Date: Tue, 4 Sep 2012 10:02:22 -0400
Re:  Strange template behavior
Are you sure you named both tags of the renamed element to "Link"? It
sounds like you inadvertently re-named the start tag to "Link" and
the end-tag to something else (either "SomethingElse" or "link" :-)

I.e.:

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


> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.