I realise that I will probably regret asking about this for the rest of my life, but... Is there some way of applying XSLT to an XML file without the XML file having an explicit reference to the XSLT file?
Personally, I thought the whole point of XSLT is that you can apply several different transformations to the same raw XML file to produce several different results from it. But that doesn't really work if the transformation has to be specified in the source XML file. It seems that to change the transformation, you have to change the underlying raw data file, which just seems wrong...
So is there some way to create some sort of file that says "take this XML and this XSLT and render the result in a browser window"?
Edit:
Perhaps my question was unclear.
If I open Notepad, write an XML file, and mention the name of an XSLT file within it, then when I double-click the XML file, the web browser applies the specified XSLT. Is there some way I can persuade the browser to do this without altering the original XML file? Or am I going to be forced to search for a command-line XSLT processor?
<script>
) and there specify the URI for the primary XSLT stylesheet module. If you want just to double-click on the XML file, there is no-way for the browser to know even that you want the XML document to be transformed using XSLT. Finally, if the XML file actually contains an XSLT stylesheet module, and it starts with anxml-stylesheet
PI pointing to itself, then the browser will apply the transformation on itself -- the transformation may know where to find the XML document and it can even be imbedded in it. – Sweatbox