Is it possible for the XML output of one CGI script to make use of XSLT output generated by another script? I ask mainly because I can’t test it right now. Basically, I’d like to know if it’s possible or valid for some page.cgi to produce:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="style.cgi?"?>
<root>
...
</root>
And some style.cgi to produce:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
...
</xsl:template>
Yes, it’s certainly possible.
Serving resources like stylesheets from server-side scripts requires a bit of work on setting the right caching headers for the response, in order to avoid the client having to re-fetch the stylesheet every time, if you care about that.