Subject:Problem with xsl:output and xsl:include Author:John Miller Date:19 Aug 2004 09:05 PM Originally Posted: 19 Aug 2004 08:54 PM
I have a stylesheet that outputs text using a xsl:output and a xsl:include. The problem is, if the output method is text the include doesn't behave as expected.
Here is a snippet of the code:
<xsl:output method="text" indent="no" encoding="utf-8"/>
<xsl:include href="Globals.xsl"/>
Here is a snippet of Globals.xsl:
<xsl:variable name="gTestData" select="document( $gTestDataFile, / )"/>
When the xsl:output method is text, the xml file contained in $gTestDataFile is not loaded. If the method is xml, it is loaded.
Is this correct?
jMM
Subject:Re: Problem with xsl:output and xsl:include Author:Minollo I. Date:20 Aug 2004 03:11 PM
Thanks for the testcase.
The problem is caused by a defect in the rendering of the variable in the
variable/watch debug windows.
Stylus Studio always displays the variable along with a summary of its
value; such value is computed as an xsl:copy-of operation applied on the
variable itself. In your case such operation only returns whitespaces when
the output method is set to text (while it returns the whole XML fragment
when it's set to xml), as the are no non-whitespace characters in any text
node in the document that you are assigning to the variable.
When such summary value is empty, Stylus Studio decides that it is not
worth allowing you to attempt further investigations/expansions of the
variable; and that is clearly a wrong decision. That behavior has now been
fixed.
Please note that this defect only affects the way the variable is rendered
in the variable/watch windows, not the way in which the processor handles
it. Also, the defect is unrelated to the use of xsl:include.
While the updated build is not yet available, you can workaround the
problem by adding a text node containing non-whitespace characters in the
document that you are assigning to the variable.
Thanks for reporting this problem and helping us,
Minollo