Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

include complete xsl file into another xsl file

 
Ashish Anil Khadilkar
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic