XML transformation

Having trouble installing Oxygen? Got a bug to report? Post it all here.
iarkin
Posts: 4
Joined: Wed Aug 20, 2014 6:26 am

XML transformation

Post by iarkin »

hi,

My team is transitioning from XMLSPY as an XML editor to oXygen as an XML editor.

One of the problems faced during this transition is for XML transform to HTML using XSLT.

Here is the error:
System ID: C:\BCALC\presentation\FB\v1\AvBen.xslt
Scenario: xml-stylesheet processing instruction
XML file: C:\Users\a333\Desktop\TC10061.xml
Engine name: Saxon6.5.5
Severity: warning
Description: Variable AvBenName has not been declared
Start location: 2508:0
The code in the AvBen.xslt where this error points to (line 2508) is

Code: Select all

<xsl:if test="$AvBenName = 'Some AvBen'">
but the variable "AvBenName" is declared in the same file and within the scope of the code (where the variable is referred) as follows

Code: Select all

<xsl:variable name="AvBenName" select="name"/>
Any guess why the transformation would fail? If I open the XML as an HTML file, the XSLT transformation happens fine. If I attempt to convert the XML using XMLSPY, the XSLT transformation happens fine.

Any inputs would be appreciated.
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: XML transformation

Post by adrian »

Hello,

XMLSPY and IE have their own XSLT engines which may be more permissive. On the other hand Oxygen relies on the Saxon XSLT engines which are strict regarding to the XSLT specification.

Are you sure that the variable is declared within the same scope (same or lower level)?
Note that if the variable is declared in another block within the same template (deeper), it's not actually available outside of that block.
e.g.

Code: Select all

<element>
<xsl:variable name="AvBenName" select="name"/>
</element>
<xsl:if test="$AvBenName = 'Some AvBen'">
=>
E [Saxon6.5.5] Variable AvBenName has not been declared
Would it be possible to send us the stylesheet to investigate? Or at least a snippet with the template/function where both the variable declaration and reference appear.
If it is possible, please send it to support@oxygenxml.com.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
iarkin
Posts: 4
Joined: Wed Aug 20, 2014 6:26 am

Re: XML transformation

Post by iarkin »

Yes, that was the issue. I noticed and fixed the issue before this post was approved by the forums admin.

The variable was declared within a <font></font> tag and possibly not "visible" to the code outside the font tag.

Thanks for your suggestion though.
Post Reply