Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
January 7, 1998
Download MSXSL.EXE (zipped, 184K). MSXSL.EXE is self-contained -- no installation is necessary. Note that installation of Internet Explorer 4.0
is required.
Download the XSL Samples (zipped, 3.7K). Place the samples in the directory containing MSXSL.EXE.
Open up a Command Prompt window and change directories to the one containing MSXSL.EXE. Then, from the command line, type:
msxsl -i sample.xml -s sample.xsl -o view1.html
Note: The "-i" option specifies the XML source document file name, "-s" specifies the file name of the XSL stylesheet, and "-o" specifies the file name of the resulting HTML file.
From an XML source document named sample.xml, the XSL processor will use an XSL stylesheet named sample.xsl to create an HTML output document named view1.html. Open view1.html with Internet Explorer 4.0 to view the results.
This time, from the command line, type:
msxsl -i sample.xml -s alternate.xsl -o view2.html
The view2.html file will now offer an alternate view of the sample.xml document.
Hint: Take a look at the source of the view1.html and view2.html documents to see what the XSL processor actually creates. You'll notice that it is simply an HTML document describing how the text within sample.xml should be displayed.
If the "-o" option is omitted, the XSL processor will give the HTML file it generates the same name as the XML source document (e.g., sample.html). Likewise, if the "-s" option is omitted, MSXSL processes the XML source document using the stylesheet with the same name as the XML source document (e.g., sample.xsl).
For example, the following command-line statement:
msxsl -i sample.xml
directs the XSL processor to use sample.xsl to generate a sample.html file.
Try the hlist.xsl stylesheet. It is a generic stylesheet that works on any XML document. This also is a good example of generating Dynamic HTML from the XML data.
msxsl -i sample.xml -s hlist.xsl -o view3.html
Since this is generic stylesheet, you can even use it on XSL documents:
msxsl -i alternate.xsl -s hlist.xsl -o alternate.htm
Did you find this article useful? Gripes? Compliments? Suggestions for other articles? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.