• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

xsl:include replaces previous defined xsl:template?

 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I have a little trouble getting xsl:include to work in my xslt file. The code looks like this:


The whole idea is to separate the header and footer files for easy changes. But when I run the page, the footer.xsl content "always" show up. The header or footer xsl file looks like this:



Does the <xsl:include> replaces the <xsl:template> portion? How to fix this include problem? The header and footer files are static html, I should also able to include "header.html" instead by setting the mime type to "xhtml+xml".

Any one have ideas? Thanks.
 
Sheriff
Posts: 28435
103
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
No, <xsl:include> includes the templates from its href reference into the program. So the net result of your two <xsl:include> elements is that you now have a program with three templates, all of which have match="/". At this point the priority rules come into play, but there isn't much point in going into that because I don't think that was what you wanted.

So before you try to "fix" anything, it would probably be a good idea for you to go back and review how it works. What you have there appears to have been based on an incorrect understanding and I think you need to start over again.
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic