Variable not defined sometimes?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Variable not defined sometimes?
This is an odd problem and to make matters worse its inconsistent.
When stepping into a template and then stepping through the variable instantiation code the variables and params are not available for inspection?
If I inspect the value the variables are being set to I can access that info?
An example
<xsl:param name="ref"/>
<xsl:variable name="textNode" select="if($ref/@xml:lang and $ref/@xml:lang='german') then //tei:text[not(@xml:lang)] else //tei:text[@xml:lang='german']"/>
the param ref is available immediately after stepping over it.
But as soon as I step into the variable textNode code the param ref is not availble and watching it I get an error that it is not declared. After stepping out of the textNode code both the param and variable textNode are still not available?
Is this normal?
When stepping into a template and then stepping through the variable instantiation code the variables and params are not available for inspection?
If I inspect the value the variables are being set to I can access that info?
An example
<xsl:param name="ref"/>
<xsl:variable name="textNode" select="if($ref/@xml:lang and $ref/@xml:lang='german') then //tei:text[not(@xml:lang)] else //tei:text[@xml:lang='german']"/>
the param ref is available immediately after stepping over it.
But as soon as I step into the variable textNode code the param ref is not availble and watching it I get an error that it is not declared. After stepping out of the textNode code both the param and variable textNode are still not available?
Is this normal?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Variable not defined sometimes?
Hello,
What version and build number of Oxygen are you using(Help -> About)?
This is usually determined by the way the debugging engine provides the current context. For Saxon-HE/PE/EE this behavior can be usually be changed from the Optimization level found under Advanced options(the toolbar button at the right of the engine combo box, with a small cog icon). Reduce the optimization level and see if that makes any difference.
Regards,
Adrian
What version and build number of Oxygen are you using(Help -> About)?
This is usually determined by the way the debugging engine provides the current context. For Saxon-HE/PE/EE this behavior can be usually be changed from the Optimization level found under Advanced options(the toolbar button at the right of the engine combo box, with a small cog icon). Reduce the optimization level and see if that makes any difference.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Variable not defined sometimes?
<oXygen/> XML Editor 13.2, build 2012011017adrian wrote:Hello,
What version and build number of Oxygen are you using(Help -> About)?
Regards,
Adrian
I will lower the optimization level. it was set at 10 which I assume is the highest.
This effects only debugging and not when applying a transformation is that correct?
thanks
Scott
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Variable not defined sometimes?
If that didn't change anything then I'm afraid this is just how Saxon provides the variables in context.
I'll log this to our issue tracking tool to investigate. If the problem is indeed from Saxon we will forward it to Saxonica.
Regards,
Adrian
I'll log this to our issue tracking tool to investigate. If the problem is indeed from Saxon we will forward it to Saxonica.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Variable not defined sometimes?
I think I figured out when it happens, an example
When I step into the template above as I step over(instantiate) each param it becomes available as you would expect.
When i hit the variable declaration that uses an if() statement the params or any preceding variables are no longer available(you get an error if you try to watch them) and they don't come back after you come back out of the if() statement.
Its like the context changes and never returns correctly for the debugger. The params are there because the code executes correctly that is using them, but you don't have access to them in the debugger.
Code: Select all
<xsl:template name="paragraphLangLink">
<xsl:param name="ref"/>
<xsl:param name="content"/>
<xsl:param name="modifyFontStyle"/>
<xsl:variable name="textNode" select="if($ref/@xml:lang and $ref/@xml:lang='german') then //tei:text[not(@xml:lang)] else //tei:text[@xml:lang='german']"/>
When i hit the variable declaration that uses an if() statement the params or any preceding variables are no longer available(you get an error if you try to watch them) and they don't come back after you come back out of the if() statement.
Its like the context changes and never returns correctly for the debugger. The params are there because the code executes correctly that is using them, but you don't have access to them in the debugger.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Variable not defined sometimes?
Hi,
So, to avoid any confusion, you're using Saxon-PE 9.3.0.5, right?
I can confirm the first part:
After the variable declaration I've added a value-of:
and when entering this, the context is again available.
Regards,
Adrian
So, to avoid any confusion, you're using Saxon-PE 9.3.0.5, right?
I can confirm the first part:
but not the second:When i hit the variable declaration that uses an if() statement the params or any preceding variables are no longer available(you get an error if you try to watch them)
I can't reproduce this, this may depend on the code that follows the variable declaration.and they don't come back after you come back out of the if() statement.
After the variable declaration I've added a value-of:
Code: Select all
<xsl:value-of select="$textNode"/>
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Variable not defined sometimes?
Yes I agree, the variables in the current context always disappear if an if() statement is reached.
The restoration of the context is problematic.
I still think this is a "MAJOR" bug. There is no way to debug variable construction if the declaration(s) are more complex than a simple assignment. How useless is that!
It makes no difference to me whether the root of the bug is in Oxygen or Saxon. It makes Oxygen's built in debugger useless at times.
If Saxon is unwilling to look at or fix the problem I think you guys need to work around it and supply us with a debugger that allows me to see the current context.
In my opinion you guys make a world class product, and you should not let Saxon bring it down.
Scott
The restoration of the context is problematic.
I still think this is a "MAJOR" bug. There is no way to debug variable construction if the declaration(s) are more complex than a simple assignment. How useless is that!
It makes no difference to me whether the root of the bug is in Oxygen or Saxon. It makes Oxygen's built in debugger useless at times.
If Saxon is unwilling to look at or fix the problem I think you guys need to work around it and supply us with a debugger that allows me to see the current context.
In my opinion you guys make a world class product, and you should not let Saxon bring it down.
Scott
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Variable not defined sometimes?
Like I said, this has been logged to our issue tracking tool and it will be investigated. If the problem is indeed from Saxon we will forward it to Saxonica.
Regards,
Adrian
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Variable not defined sometimes?
Hi,
This bug has reached the analysis stage and we're trying to determine what's causing the restoration of the context problem that you're describing. As I've mentioned in one of my previous comments I could not reproduce this particular problem with the code you provided. After your sample code I've added a simple xsl:copy-of that uses that variable: But this code does not seem to trigger the restoration of the context problem you're describing. After reaching the if (where the entire context is invalidated) and pressing Step In, the debugger stops on the xsl:copy-of that I've added and I get the correct variables in context: textNode (evaluated only if the optimization level was set to 0), ref, modifyFontStyle and content.
After another Step In the debugger finishes execution because of the limited sample.
Could you please tell me what follows in your code after the textNode variable definition?
A full stylesheet would be very useful for analyzing this, or at least the complete xsl:template.
If you want to keep it off the forum, you can send it to our support email address: support AT oxygenxml DOT com
For the other problem "the variables in the current context always disappear if an if() statement is reached" we already have a sample that reproduces the issue and we are currently looking into a solution.
Regards,
Adrian
This bug has reached the analysis stage and we're trying to determine what's causing the restoration of the context problem that you're describing. As I've mentioned in one of my previous comments I could not reproduce this particular problem with the code you provided. After your sample code I've added a simple xsl:copy-of that uses that variable:
Code: Select all
<xsl:copy-of select="$textNode"/>
After another Step In the debugger finishes execution because of the limited sample.
Could you please tell me what follows in your code after the textNode variable definition?
A full stylesheet would be very useful for analyzing this, or at least the complete xsl:template.
If you want to keep it off the forum, you can send it to our support email address: support AT oxygenxml DOT com
For the other problem "the variables in the current context always disappear if an if() statement is reached" we already have a sample that reproduces the issue and we are currently looking into a solution.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Variable not defined sometimes?
Hi,
We've isolated and resolved the problem ("the variables in the current context always disappear if an if() statement is reached") in the current development stream and the bugfix will be available in v14.1.
The context was lost (variables being undefined) when the debugger was tracing into XPath expressions. This feature is controlled by an option: Options > Preferecnes > XML > XSLT-FO-XQuery > XSLT > Saxon > Saxon-HE/PE/EE, Debugger trace into XPath expressions.
For older versions of Oxygen (v14.0 and earlier) you can disable this option to avoid the issue, if you find it troublesome.
If you're interested in a beta of v14.1 to test this bugfix, please write to our support email address: support AT oxygenxml DOT com
Regards,
Adrian
We've isolated and resolved the problem ("the variables in the current context always disappear if an if() statement is reached") in the current development stream and the bugfix will be available in v14.1.
The context was lost (variables being undefined) when the debugger was tracing into XPath expressions. This feature is controlled by an option: Options > Preferecnes > XML > XSLT-FO-XQuery > XSLT > Saxon > Saxon-HE/PE/EE, Debugger trace into XPath expressions.
For older versions of Oxygen (v14.0 and earlier) you can disable this option to avoid the issue, if you find it troublesome.
If you're interested in a beta of v14.1 to test this bugfix, please write to our support email address: support AT oxygenxml DOT com
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Variable not defined sometimes?
Fantastic news!!!
I'll wait for the official release of 14.1 as I'm up to my elbows in a xml transformation project and don't have time righ tnow to play beta tester.
thanks for pursuing this.
Scott

I'll wait for the official release of 14.1 as I'm up to my elbows in a xml transformation project and don't have time righ tnow to play beta tester.
thanks for pursuing this.
Scott
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service