How to insert a stylesheet reference in an XML program generated data set?

Feb 17 2010 11:35 PM
I have an XML data set, program generated, where the first two lines of the file are as follows:

<?xml version="1.0"?>
<MyDataFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

I want to be able to read the data via a browser.

Using a text editor, I can insert the following line immediately following the first line:

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

Click on the XML data file and I see the the desired results in a browser.

How do I embedd the stylesheet reference programatically?


Answers (2)