Hi,
I have a fairly large and complex XSL (around 1000 lines) that is used to convert XML into XHTML and display inside a webpage. I have a new situation where I need to add a header and footer to this stylesheet before I transform the XML with it. So, what I'm trying to do is write a stylesheet to transform my orginal stylesheet into a new stylesheet, and then use that for processing.
So something like this:
So I'm having problems with the modify XSL working properly. Here is what I have so far:
My idea was that I could add the HTML and BODY tags, as well as Header and Footer HTML to my original stylesheet. The problem is that is seems to be processing the original stylesheet instead of just copying all of its code into the new one. Is what I'm trying to do possible? Am I on the right track?
Thanks for the advice!
-Mike
I have a fairly large and complex XSL (around 1000 lines) that is used to convert XML into XHTML and display inside a webpage. I have a new situation where I need to add a header and footer to this stylesheet before I transform the XML with it. So, what I'm trying to do is write a stylesheet to transform my orginal stylesheet into a new stylesheet, and then use that for processing.
So something like this:
Code:
//Get XML and XSL
v_xml = getXML();
v_original_xsl = getXSL("largeXSL");
v_modify_xsl = getXSL("modifyXSL");
//Transform the original stylesheet with my modify stylesheet
v_new_xsl = v_original_xsl.transform(v_modify_xsl);
//Use new stylesheet to transform my xml
v_output = v_xml.transform(v_new_xsl);
So I'm having problems with the modify XSL working properly. Here is what I have so far:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] version="2.0" xmlns:xso="dummy">
<xsl:output method="xml"/>
<xsl:template match="xsl:stylesheet">
<xso:stylesheet>
<html>
<body>
<h1>Header</h1>
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
<h1>Footer</h1>
</body>
</html>
</xso:stylesheet>
</xsl:template>
</xsl:stylesheet>
My idea was that I could add the HTML and BODY tags, as well as Header and Footer HTML to my original stylesheet. The problem is that is seems to be processing the original stylesheet instead of just copying all of its code into the new one. Is what I'm trying to do possible? Am I on the right track?
Thanks for the advice!
-Mike