XSLT debugger output not updated

Having trouble installing Oxygen? Got a bug to report? Post it all here.
bmf1972
Posts: 5
Joined: Mon Jul 19, 2004 8:45 pm

XSLT debugger output not updated

Post by bmf1972 »

Hi all,

During XSLT debugging, the XSLT output pane is not dynamically updated (as documented).

Any special "setting" required?

Thanx,
Adrian.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Adrian,

The output is not necessary generated after the debugger passes over an element in the stylesheet. For instance the processor does not emit anything when it encounters the test element below:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<test>
<a>
<b> some text content </b>
</a>
</test>
</xsl:template>
</xsl:stylesheet>

The reason for this is that there can be attributes defined next with xsl:attribute that should be emited before closing the start tag. Therefore the test start tag will be emmited when the next start tag is encountered, that is a.

If you still have problems you may consider posting a cut down sample stylesheet and eventually source document to allow us to reproduce the behavior.

Best Regards,
George
bmf1972
Posts: 5
Joined: Mon Jul 19, 2004 8:45 pm

here is a testcase

Post by bmf1972 »

Hi George,

Here is the input XML:

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="123">
<para />
<para />
<para />
</root>

Here is the processing XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:src="123" xmlns:out="abc" version="1.0">

<xsl:output cdata-section-elements="out:text" />

<xsl:template match="/">
<out:text>
<xsl:apply-templates select="src:root/src:para" />
</out:text>
</xsl:template>

<xsl:template match="src:para">
para
</xsl:template>

</xsl:stylesheet>

Here is the expected output XML:

<?xml version="1.0" encoding="utf-8"?><out:text xmlns:out="abc" xmlns:src="123"><![CDATA[
para

para

para
]]></out:text>

Using the debugger's stepping feature, it was expected to see the text "para" showing one after another - but it shows once at the end of the debugging session.

It seems that the problem is the combination of the "xsl:output" element and the namespaces. Try to take out one or another or both and the debugger works as expected.

Hope it helps,
Adrian.

BTW, I think I deserve a free license for my effort ;-)
You can send me the activation code at bmf1972_at_icqmail.com - thank you very much!
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Adrian,

Oxygen presents the output as the XSLT processor emits that output., more this is XSLT processor dependent.

In the sample you presented you defined the out:text content to be a CDATA section, therefore Saxon will buffer internally the content of the element and then emits it to the output once the element closing tag is encountered.
If you will try Xalan you will see that it generates the "para" one after another, as you expected.

Best Regards,
George
Post Reply