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

Re: [xsl] XSLT 2.0 compability issue occured in topicmerge.XSL in DITA OT1.5.1.

Subject: Re: [xsl] XSLT 2.0 compability issue occured in topicmerge.XSL in DITA OT1.5.1.
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 24 Sep 2012 12:45:53 +0100

Have you checked whether this is fixed in a later DITA release? You're using quite an old one.

If it reproduces with the latest DITA stylesheets, then it might be useful to post sufficient information so that other people can reproduce the problem and perhaps diagnose the bug.

With Saxon, the best way of diagnosing the bug is to run with the -T option. This produces very voluminous trace output, of which the interesting part is the last few instructions executed before the failure occurred.

Note that it's not entirely accurate to describe this as an XSLT 2.0 compatibility issue; it's more of a 1.0 interoperability issue that was fixed in 2.0. Writing an attribute after writing children of an element was an error in XSLT 1.0: "implementations may either signal the error or ignore the attribute", so the stylesheet would fail with some XSLT 1.0 processors and "succeed" with others. What has changed in 2.0 is that all processors are required to behave in the same way (by reporting the error).

Michael Kay

On 24/09/2012 11:43, team wise wrote:
Hi there,
I am stuck in a prolem with the XSLT 2.0 stylesheet which Michale has
commented on earlier, the thread reads: XSLT 2.0 compability issue
occured in topicmerge.XSL in DITA 1.5.1.
Now a similar problem occurs:

Problem: Publishing publications with sub-map structures failed.
Fatal Error! An attribute node (role) cannot be created after the
children of the containing element
An expected XML skeleton within a MERGED.XML structure shall be as follows:
<link role="child">
Below lines are where the failure occurs:

<xsl:template match="*|@*|comment()|processing-instruction()|text()"
<xsl:param name="src-file"></xsl:param>
<xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"
<xsl:with-param name="src-file"><xsl:value-of

When I applied the nested Elements as follows, the build always points
me to the same line of failure:

<!--@role fixes somc start-->
<xsl:template match="*[contains(@class,' map/topicref ')][@role]">

<xsl:element name="link">
<xsl:apply-templates select="@role" mode="copy-element"/>
<xsl:attribute name="refclass"><xsl:value-of
<xsl:apply-templates select="*" mode="copy-element"/>
<!--xsl:apply-templates select="@role" mode="copy-element"/-->
<xsl:element name="linktext"> <xsl:apply-templates select="@*"
mode="copy-element"/> </xsl:element> <desc/> </xsl:element>


My question ,  how to overwrite the above line of '
mode="copy-element"> so it can ' forcefully injecting the XSL
related-links, Linkpool, Link, Linktexst plus DESC elements plus their
associated attributes'?

I look forward to hearing from you again.

Current Thread