Re: Linking an style*** outside the XML instance



leosarasua@xxxxxxxxx wrote:
One of the great things about XML, I find, is that you can do lots of
things with an XML instance without modifying it. You can have any
kind of processing and displaying by writing a style*** separate
from the XML document.

However, the reference to the style*** has to be in the XML
document, which already forces you to modify it every time you want to
use a different XSL.This is really inconvenient: in my case, I have a
huge database of XML documents, and I need to process them with
different XSL's depending on the application. Obviously, I don't want
to modify all the XML documents each time.

My question is: what was the reason to design the use of XSL like
this?

Couldn't the XSL be chosen, for example, in the XML processor (i.e.
the browser)?

You are right that client-side XSLT in the browser, where you want to load the XML document in a browser window, depends on the xml-style*** processing instruction. But XSLT in general does not, rather you have an XSLT processor that has a command line feature to select both XML and XSLT document and/or the processor has an API you can use to provide XML and XSLT document. Even inside the browser XSLT processors have an API exposed to script, for Mozilla, Opera 9 and Safari 3 see
<URL:http://developer.mozilla.org/en/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations>,
for IE 6 and later see
<URL:http://msdn2.microsoft.com/en-us/library/ms762799.aspx>


--

Martin Honnen
http://JavaScript.FAQTs.com/
.