Click to See Complete Forum and Search --> : Changing dynamically stylesheet ?


herodote92
09-22-2005, 04:18 AM
Perhaps this is a stupid question , but anyway:

In my XML page, I have something like:

<?xml-stylesheet type="text/xsl" href="./MCD.xsl"?>


This works all right, the transformations are OK, and the result is a HTML page just like I wished it.

Now is there any possibility, using any tool (JavaScript or whatever), to let the user change dynamically the stylesheet used, so that he will get the same data as those enclosed in the main XML page, but presented a different way ? I want the XML page to remain unchanged, except for the xsl stylesheet to be used.

I'm completely lost here. Any ideas welcome. :confused: :confused: :confused:

herodote92
09-22-2005, 11:47 AM
Bump... I temporarily solved the problem by storing all the XML data in external entities, and making some different XML headers referring to different stylesheets and to the same external entity (so every XML main page is just about 5 or 6 lines long).

Then I show the transformed XML in an iframe, and buttons allow me to change the iframe source document... :p ;) :D

But of course, as I mentioned in another thread, external entities are still Hebrew for Firefox... Nothing is perfect is this valley of tears. :(