tags:

views:

27

answers:

2

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"&gt;
<xsl:template match="/">
    ...
</xsl:template>
A: 

I do not see any reason, why this should not work...

Markus Pilman
+1  A: 

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.

bobince
Thanks for the tip. I'm not too concerned with the details, since this is pretty much just a curiosity. Something to file away in the memory banks, as it were.
Jon Purdy