• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

include complete xsl file into another xsl file

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I recall, xsl:include has to be a top-level element. Does your XSLT reference not say that?
 
reply
    Bookmark Topic Watch Topic
  • New Topic