I have X number of separate XSL files and all of them should be using the same template from a separate file. However, some of my XSL files outputs plain text, some outputs HTML and some outputs XML. My issue it that only the XSL's with an 'xsl:output method' attribute matching the one from my separate template file are valid. If I remove the output element from the template file I believe it will default to 'xsl:output method="xml"'? How can I get around this so that I can use the same template for all my XSL's even if they have different output methods?
Asked
Active
Viewed 66 times
1
-
1Good question - however would only make sense if your "template" output text only that could be used in stylesheets with both text and xml output methods? If left out, output method depends on the first thing the stylesheet generates - if it's an xml node then it defaults to xml, html node to html and if the first thing it produces is text, it will be output method text. I'd give it a try and leave the output method out of the template. – Stefan Hegny Apr 05 '17 at 14:26
-
1BTW you might specify what processor you are using and how you found out that "only the XSL's with an 'xsl:output method' attribute matching the one from my separate template file are valid" – Stefan Hegny Apr 05 '17 at 14:28
-
Possible duplicate of [how to pass a parameter and use that in my xslt](http://stackoverflow.com/questions/4322807/how-to-pass-a-parameter-and-use-that-in-my-xslt) – Paul Sweatte May 16 '17 at 19:29