Can you embed xsl style sheets in xml documents
Posted: Wed Jul 26, 2006 6:48 pm
Hello
I have some xml that is generated on our server (dumpped from an SQL database) and I'd like to format it using an external XSL style sheet so that it appears in a friendly table for users in their browser.
My problem/question is this. Presumably the browser needs to download both the xml and the xsl files so I'm confused as to what to put in the href in the following declaration
<?xml-stylesheet type="text/xsl" href="??????"?>
If I just put the xsl file name doesn't it have to be in the same local directory? If so does this mean that I have to save it to the servers file system locally in the same folder as the style sheet? (Which I would rather avoid)
Should I publish the xsl somewhere globally available?, eg
http://www.acme.com/StyleSheets/FormPro ... erview.xsl
Or is there a way of embedding the xsl into the top of the xml as you can in html? so that it can all be sent back to the browser in one go.
Thanks for any advice.
Christian
I have some xml that is generated on our server (dumpped from an SQL database) and I'd like to format it using an external XSL style sheet so that it appears in a friendly table for users in their browser.
My problem/question is this. Presumably the browser needs to download both the xml and the xsl files so I'm confused as to what to put in the href in the following declaration
<?xml-stylesheet type="text/xsl" href="??????"?>
If I just put the xsl file name doesn't it have to be in the same local directory? If so does this mean that I have to save it to the servers file system locally in the same folder as the style sheet? (Which I would rather avoid)
Should I publish the xsl somewhere globally available?, eg
http://www.acme.com/StyleSheets/FormPro ... erview.xsl
Or is there a way of embedding the xsl into the top of the xml as you can in html? so that it can all be sent back to the browser in one go.
Thanks for any advice.
Christian