aspose file tools*
The moose likes XML and Related Technologies and the fly likes include complete xsl file into another xsl file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "include complete xsl file into another xsl file" Watch "include complete xsl file into another xsl file" New topic
Author

include complete xsl file into another xsl file

Ashish Anil Khadilkar
Greenhorn

Joined: Jul 13, 2006
Posts: 18
Hi,
I have three xsl files and two xml files, depending upon xml files root node i want to include one complete xsl file into another.Let us assume I have a.xsl and b.xsl if rootnode is 'a' then i want to include a.xsl into c.xsl if rootnode is 'b' then I would like to nclude it into c.xsl.Can anyone please help me out.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

xsl:include is a static instruction, i.e. it is performed when the XSL is compiled. So you can't do what you asked.

But perhaps you can include both of them and use an xsl:if element to decide which to use at run time?
Ashish Anil Khadilkar
Greenhorn

Joined: Jul 13, 2006
Posts: 18
Hi I did that but I am getting one error include could not used at that position in stylesheet.Could you please help me in this.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

If I recall, xsl:include has to be a top-level element. Does your XSLT reference not say that?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include complete xsl file into another xsl file