View Full Version : XSLT automatically client side

03-11-2006, 03:28 AM

how can I make an XSLT Transformation client side automatically ??

Thanx for any help !

03-11-2006, 06:15 AM
Include the following at the top of your XML pages (after the xml prologue, if you have one):

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

Although there is no text/xsl mime-type, as I understand it IE requires it to be specified. For other browsers, the mime-type of the actually stylesheet takes precedence, so it all works out. Your XSLT document should be served with a mime-type of application/xml or text/xml, btw.

03-11-2006, 07:34 AM
Thanx for your reply.
I think I have to subscribe my problem more detailed.

Im trying to generate an SVG File dynamically. On a HTML-File, a user can choose his XML-File, and the browser (in this case the IE) transforms the XML to SVG.

My Idea: Load the XML File, parse it, read the nodes, an transform the selected nodes with saxon to an SVG-File.

My scriptcode till now:

function ReadFileToString(p_file_name)

function WriteStringToFile(p_string,p_file_name)

function GetXMLTags()

function ConvertXMLToSVG(p_file_name)
var l_source_code=ReadFileToString(p_file_name);
if(l_source_code.length) {
// here I need to transform dynamically with saxon to SVG
xml_imp=new DOMImplementation();

// WriteStringToFile(l_source_code,"Z:\\svg\output.svg");

Thanx !