Trouble with variable not declared
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 2
- Joined: Sun Mar 19, 2006 10:09 am
Trouble with variable not declared
I just try Oxygen on eclipse with a a project which use lot of xsl:include
Even if the transformation work well whithout any error or warning, Ive got errors in the Problems view : "Variable not declared". But it's normal that these variables aren't declared because the xslt is included in another xslt which contain the variable declaration.
Is it a way to avoid these errors messages ?
Another mystery : I can see nothing in the Browser view wathever the file i edit ... Is there something particular to do for seeing something ?
Thanks
Even if the transformation work well whithout any error or warning, Ive got errors in the Problems view : "Variable not declared". But it's normal that these variables aren't declared because the xslt is included in another xslt which contain the variable declaration.
Is it a way to avoid these errors messages ?
Another mystery : I can see nothing in the Browser view wathever the file i edit ... Is there something particular to do for seeing something ?
Thanks
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
Indeed, stylesheets can be invalid by themselves but the same code can be valid when included/imported from other stylesheets. There is not very much you can do about that now, you can eventually use the Clear validation markers action to remove the errors manually.
I rised this issue on the XSL list some time ago and we will probably implement the result of that discussion in the future - allow specifying a main document for a module stylesheet:
http://www.oxygenxml.com/archives/xsl-l ... 00050.html
Best Regards,
George
Indeed, stylesheets can be invalid by themselves but the same code can be valid when included/imported from other stylesheets. There is not very much you can do about that now, you can eventually use the Clear validation markers action to remove the errors manually.
I rised this issue on the XSL list some time ago and we will probably implement the result of that discussion in the future - allow specifying a main document for a module stylesheet:
http://www.oxygenxml.com/archives/xsl-l ... 00050.html
Best Regards,
George
-
- Posts: 2
- Joined: Sun Mar 19, 2006 10:09 am
Hi,
Thank for you answer. When thinking about it, it's logical that the compiler can't know which file will import or include the file which is compiled...
Here is the solution that I use to bypass this trouble :
In the main xslt
In the included xslt
It's not very elegant but ... it's work
Thank for you answer. When thinking about it, it's logical that the compiler can't know which file will import or include the file which is compiled...
Here is the solution that I use to bypass this trouble :
In the main xslt
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="include.xsl"/>
<xsl:variable name="filesPath" select="main/@path"/>
<xsl:template match="body">
<a href="{$filesPath-header}{@link}">link from body</a>
<xsl:apply-templates select="header"/>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="filesPath-header" select="main/@path"/>
<xsl:template match="header">
<a href="{$filesPath-header}{@link}">link from header</a>
</xsl:template>
</xsl:stylesheet>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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