| ||||||||||||||
| ||||||||||||||
|
||||||||||||||
|
Recently, I wanted a way to visualize large SAPI grammar files in a slightly easier way than using Microsoft Internet Explorer's default XML viewing capability. The obvious solution to me seemed to be to write a XSL stylesheet to convert the grammar into pretty HTML. Therefore, I set out trying my hand at producing a XSL stylesheet, and sure enough, 3 hours later, I had something that produced relatively nice results. The features are as follows:
UsageUsing the stylesheet is very simple to do. Open up your grammar file, and add the following lines at the very top:<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="http://www.generation5.org/data/xml/sapi2html.xsl"?>Open up your grammar file and hopefully things will look a lot neater. Alternatively, you can download sapi2html.xsl as a local copy and modify it as you wish. Using the hyperlinked version means you don't need to copy the file between projects, and ensures you always have the most up-to-date version formatting your SAPI grammar.
History5.4.03 v0.9 A few bugs fixed, and a few additional features added. Now recognizes both P and PHRASE, L and LIST, O and OPT. The stylesheet also formats some additional TITLE tags so that tooltips popup with additional phrase information (Min, Max, Propname attributes). The embedded RULEREF issue is now fixed too.
Last Updated: 04/05/2003 Article content copyright © James Matthews, 2003.
|
|
|||||||||||||
All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -