Accessing an Global Parameter from inside a included stylesheet.

E

Eshrath Khan

Hi all,


I have a .Net program which access transforms a XML using an XSL
stylesheet. The .net program calls Stylesheet main.xsl file.

The main.xls contains only <xsl:include> elements to include other XSL
files.

like


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:include href="../one.xsl"/>
<xsl:include href="../two.xsl"/>
<xsl:include href="../three.xsl"/>
<xsl:include href="../four.xsl"/>
<xsl:include href="../five.xsl"/>
<xsl:eek:utput indent="yes" media-type="html"/>
</xsl:stylesheet>


Now I want to pass a parameter to the XSL from .Net. This parameter will
be used by the template present in two.xsl file. ie., it will be used
globally.

So I have added the Argumentlist (which is used to pass the parameter to
the XSL) in the .Net and the <xsl:param> in the main.xsl file. Now the
main.xsl looks like


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="esh" />
<xsl:include href="../one.xsl"/>
<xsl:include href="../two.xsl"/>
<xsl:include href="../three.xsl"/>
<xsl:include href="../four.xsl"/>
<xsl:include href="../five.xsl"/>
<xsl:eek:utput indent="yes" media-type="html"/>
</xsl:stylesheet>



Now when i try to access this global variable from two.xsl it is
throwing error and it is not able to access the globa variable.

So is there a way to access the global parameter from the included
stylesheets. This is very urgent. Please reply back to me and also post
it in the forum.

Thanks and Regards,
-Eshrath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top