<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Eric's Blog</title>
    <link>http://www.nextivr.com/ericp/</link>
    <description>Everything Speech and IVR</description>
    <language>en-us</language>
    <copyright>Eric Phetteplace</copyright>
    <lastBuildDate>Wed, 09 Apr 2008 18:49:04 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>blogAdmin@nextivr.com</managingEditor>
    <webMaster>blogAdmin@nextivr.com</webMaster>
    <item>
      <trackback:ping>http://www.nextivr.com/ericp/Trackback.aspx?guid=a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb</trackback:ping>
      <pingback:server>http://www.nextivr.com/ericp/pingback.aspx</pingback:server>
      <pingback:target>http://www.nextivr.com/ericp/PermaLink,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx</pingback:target>
      <dc:creator>ericp@nextivr.com (Eric Phetteplace)</dc:creator>
      <wfw:comment>http://www.nextivr.com/ericp/CommentView,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx</wfw:comment>
      <wfw:commentRss>http://www.nextivr.com/ericp/SyndicationService.asmx/GetEntryCommentsRss?guid=a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
   Transcribing speech utterances is a highly repetitive task, usually performed by a
   pool of people who are good at typing.<br /><br />
   Out of the box, the speech server tools for transcribing are accessible through Visual
   Studio, and are not good for transcribing any volume of utterances.<br /><br />
   The following attachment contains two Visual Studio 2005 projects that can get you
   on your way towards a fast transcription process for non developers (no Visual Studio
   needed for them).<br /><br /><br /><a href="http://www.nextivr.com/ericp/content/binary/MSSTranscriptionService.zip">MSSTranscriptionService.zip
   (3.75 MB)</a><img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb" /></body>
      <title>Transcribing for MS Speech Server</title>
      <guid>http://www.nextivr.com/ericp/PermaLink,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx</guid>
      <link>http://www.nextivr.com/ericp/PermaLink,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx</link>
      <pubDate>Wed, 09 Apr 2008 18:49:04 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
Transcribing speech utterances is a highly repetitive task, usually performed by a
pool of people who are good at typing.&lt;br&gt;
&lt;br&gt;
Out of the box, the speech server tools for transcribing are accessible through Visual
Studio, and are not good for transcribing any volume of utterances.&lt;br&gt;
&lt;br&gt;
The following attachment contains two Visual Studio 2005 projects that can get you
on your way towards a fast transcription process for non developers (no Visual Studio
needed for them).&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.nextivr.com/ericp/content/binary/MSSTranscriptionService.zip"&gt;MSSTranscriptionService.zip
(3.75 MB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb" /&gt;</description>
      <comments>http://www.nextivr.com/ericp/CommentView,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.nextivr.com/ericp/Trackback.aspx?guid=f7f2d34b-368c-476d-8ac3-86a71f217f7f</trackback:ping>
      <pingback:server>http://www.nextivr.com/ericp/pingback.aspx</pingback:server>
      <pingback:target>http://www.nextivr.com/ericp/PermaLink,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx</pingback:target>
      <dc:creator>ericp@nextivr.com (Eric Phetteplace)</dc:creator>
      <wfw:comment>http://www.nextivr.com/ericp/CommentView,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx</wfw:comment>
      <wfw:commentRss>http://www.nextivr.com/ericp/SyndicationService.asmx/GetEntryCommentsRss?guid=f7f2d34b-368c-476d-8ac3-86a71f217f7f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Unit testing code is important. If you make code changes in a library that other people
      are using, you want to make sure all of the code works as expected. Using NUnit is
      great for that.
   </p>
        <p>
      However, when it comes to speech applications, you probably manually test your applications
      before each release.
   </p>
        <p>
      If you are writing managed code for Office Communications Server 2007 Speech Server,
      and you are using a SIP for your telephony lines, I have something that will help
      you automate your testing. I created a simple class that will send SIP INFO requests
      to the caller if they include "log=true" in the SIP URI parameters. It basically works
      like this:
   </p>
        <ol>
          <li>
         Call into your application and then generate a test script based on the call log. 
      </li>
          <li>
         Run the customized OutboundCalls application, passing your newly generated script
         as the script to run. 
      </li>
          <li>
         The OutboundCalls application will automatically go through the application, following
         the same path. 
      </li>
        </ol>
        <p>
      Attached is the unit testing code, a demo and some basic instructions. Open the UnitTesting
      solution and read the ReadMe.htm file for all the details.
   </p>
        <p>
      Happy Testing!
   </p>
        <a href="http://www.nextivr.com/ericp/content/binary/UnitTesting.zip">UnitTesting.zip
   (8 MB)</a>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=f7f2d34b-368c-476d-8ac3-86a71f217f7f" />
      </body>
      <title>Unit Testing Managed Speech Server Applications</title>
      <guid>http://www.nextivr.com/ericp/PermaLink,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx</guid>
      <link>http://www.nextivr.com/ericp/PermaLink,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx</link>
      <pubDate>Thu, 03 Apr 2008 17:13:06 GMT</pubDate>
      <description>&lt;p&gt;
   Unit testing code is important. If you make code changes in a library that other people
   are using, you want to make sure all of the code works as expected. Using NUnit is
   great for that.
&lt;/p&gt;
&lt;p&gt;
   However, when it comes to speech applications, you probably manually test your applications
   before each release.
&lt;/p&gt;
&lt;p&gt;
   If you are writing managed code for Office Communications Server 2007 Speech Server,
   and you are using a SIP for your telephony lines, I have something that will help
   you automate your testing. I created a simple class that will send SIP INFO requests
   to the caller if they include "log=true" in the SIP URI parameters. It basically works
   like this:
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      Call into your application and then generate a test script based on the call log. 
   &lt;li&gt;
      Run the customized OutboundCalls application, passing your newly generated script
      as the script to run. 
   &lt;li&gt;
      The OutboundCalls application will automatically go through the application, following
      the same path. 
&lt;/ol&gt;
&lt;p&gt;
   Attached is the unit testing code, a demo and some basic instructions. Open the UnitTesting
   solution and read the ReadMe.htm file for all the details.
&lt;/p&gt;
&lt;p&gt;
   Happy Testing!
&lt;/p&gt;
&lt;a href="http://www.nextivr.com/ericp/content/binary/UnitTesting.zip"&gt;UnitTesting.zip
(8 MB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=f7f2d34b-368c-476d-8ac3-86a71f217f7f" /&gt;</description>
      <comments>http://www.nextivr.com/ericp/CommentView,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.nextivr.com/ericp/Trackback.aspx?guid=fb6fd509-52db-47fa-9dc3-3e343cbc8113</trackback:ping>
      <pingback:server>http://www.nextivr.com/ericp/pingback.aspx</pingback:server>
      <pingback:target>http://www.nextivr.com/ericp/PermaLink,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx</pingback:target>
      <dc:creator>ericp@nextivr.com (Eric Phetteplace)</dc:creator>
      <wfw:comment>http://www.nextivr.com/ericp/CommentView,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx</wfw:comment>
      <wfw:commentRss>http://www.nextivr.com/ericp/SyndicationService.asmx/GetEntryCommentsRss?guid=fb6fd509-52db-47fa-9dc3-3e343cbc8113</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In the health industry, I've frequently run into the following predicament: 
      User IDs are no longer simple numeric fields.  Traditionally, an employee's Social
      Security number may have been used as an id, but HIPAA has put an end to that.
   </p>
        <p>
      For speech recognition, this could present a common tuning and maintenance issue. 
      The following XSLT document is designed to automate this maintenance.
   </p>
        <p>
      First, let's take a look at some simple user IDs stored in my sample database.
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> UserIDs <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> SampleIDs</span>
        </p>
        <p>
      UserIDs                                                      
      <br />
      ------<br />
      119821<br />
      319871<br />
      31987M<br />
      D19821<br />
      D1982M<br />
      D19871<br />
      ...
   </p>
        <p>
      You can see there are a few alphanumeric patterns being used with these IDs. 
      Using a simple replacement, we can get all the non-numeric patterns in the database:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>
            <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(UserIDs, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'1'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'2'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'3'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'4'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'5'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'6'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'7'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'8'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'9'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'0'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> Pattern, 
      <br /><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">COUNT</span>(*) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> RecordCount 
      <br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> SampleIDs<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GROUP</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(UserIDs, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'1'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'2'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'3'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'4'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'5'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'6'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'7'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'8'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'9'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'0'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>)<br /><br /></span>
        </p>
        <p>
      Pattern RecordCount 
      <br />
      ------------------- 
      <br />
      D_____  71680<br />
      _____M  57344<br />
      X____M  14336<br />
      D____M  71680<br />
      X_____  14336<br />
      ______  57344
   </p>
        <p>
      With this, we'll simply assume there is an even chance for any of these patterns being
      used on a call.  So, D_____ has the probability of 71680/286720 or a 25% chance
      of being provided.  Using this information, we can weight the probability of
      this pattern matching an utterance for a user ID.
   </p>
        <p>
      First, I run the above SQL statement and put the results into a dataset.  You
      can simply create the XML from the recordset, too.  My XML results look like
      this:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;records&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;D_____&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;71680&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;_____M&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;57344&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;X____M&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;14336&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;D____M&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;71680&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;X_____&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;14336&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;______&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;57344&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;/records&gt;<br /><br /></span>
        </p>
        <p>
      Now comes the fun part - using XSLT to create a GRXML grammar file.
   </p>
        <p>
      A couple of points about the XSL file:
   </p>
        <ol>
          <li>
         For the JavaScript function buildCharacterArray(s1), you could probably slim the function
         down to "return s1.split('');"  It splits a string into a character array. 
      </li>
          <li>
         XSLT doesn't have a for-each loop, so I recursively call the buildItem template. 
      </li>
          <li>
         In this example, the TAG is set as an attribute of the related ITEM element. 
         For other platforms, this may need to be an element trailing the ITEM element. 
         Of course, the tag syntax is different on each platform:( 
      </li>
          <li>
         In the real world you may find, through transcriptions and tuning, that people may
         utter dashes and spaces, too, or say, "B as in boy."  They may also truncate
         leading 0's (00001214V may be spoken 1214V). 
      </li>
          <li>
         It doesn't handle robust recognition for utterances like "nine double oh one seven"
         or "nine thirty nine twenty two."  Unless you find patterns through transcriptions
         and tuning, effectively accommodating this will drop your accuracy and performance
         through the floor. 
      </li>
          <li>
         Use your web server to cache the GRXML output; there's no need to run it too often.</li>
        </ol>
        <p>
      The resulting grammar looks like this :<br /></p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;?xml
      version=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1.0"</span> encoding=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"utf-8"</span> ?&gt; 
      <br />
      &lt;grammar xml:lang=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"en-US"</span> version=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1.0"</span> root=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"main"</span> mode=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"voice"</span> xmlns:msxsl=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"urn:schemas-microsoft-com:xslt"</span> xmlns:nextivr=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://www.nextivr.com/XSLFunctions"</span> xmlns:rs=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"urn:schemas-microsoft-com:rowset"</span>&gt;<br />
      &lt;rule id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"main"</span> scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"public"</span>&gt;<br />
      &lt;one-of&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.25"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#D_____"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.2"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#_____M"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.05"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#X____M"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.25"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#D____M"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.05"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#X_____"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.2"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#______"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;/one-of&gt;<br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D_____"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D"</span>&gt;D&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"_____M"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"M"</span>&gt;M&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X____M"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X"</span>&gt;X&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"M"</span>&gt;M&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D____M"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D"</span>&gt;D&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"M"</span>&gt;M&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X_____"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X"</span>&gt;X&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"______"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"number"</span>&gt;<br />
      &lt;one-of&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1"</span>&gt;one&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"2"</span>&gt;two&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"3"</span>&gt;three&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"4"</span>&gt;four&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"5"</span>&gt;five&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"6"</span>&gt;six&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"7"</span>&gt;seven&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"8"</span>&gt;eight&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"9"</span>&gt;nine&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0"</span>&gt;zero&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/one-of&gt;<br />
      &lt;/rule&gt;<br />
      &lt;/grammar&gt;<br /><br /><a href="content/binary/AlphaNumIDsToGrammar.zip">Download the code!</a><br /><br /></span>
        </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=fb6fd509-52db-47fa-9dc3-3e343cbc8113" />
      </body>
      <title>A Grammar for AlphaNumeric IDs</title>
      <guid>http://www.nextivr.com/ericp/PermaLink,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx</guid>
      <link>http://www.nextivr.com/ericp/PermaLink,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx</link>
      <pubDate>Tue, 05 Jun 2007 15:02:22 GMT</pubDate>
      <description>&lt;p&gt;
   In the health industry, I've frequently run into the following predicament:&amp;nbsp;
   User IDs are no longer simple numeric fields.&amp;nbsp; Traditionally, an employee's Social
   Security number may have been used as an id, but HIPAA has put an end to that.
&lt;/p&gt;
&lt;p&gt;
   For speech recognition, this could present a common tuning and maintenance issue.&amp;nbsp;
   The following XSLT document is designed to automate this maintenance.
&lt;/p&gt;
&lt;p&gt;
   First, let's take a look at some simple user IDs stored in my sample database.
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; UserIDs &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; SampleIDs&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   UserIDs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
   &lt;br&gt;
   ------&lt;br&gt;
   119821&lt;br&gt;
   319871&lt;br&gt;
   31987M&lt;br&gt;
   D19821&lt;br&gt;
   D1982M&lt;br&gt;
   D19871&lt;br&gt;
   ...
&lt;/p&gt;
&lt;p&gt;
   You can see there are a few alphanumeric patterns being used with these IDs.&amp;nbsp;
   Using a simple replacement, we can get all the non-numeric patterns in the database:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(UserIDs, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'1'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'2'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'3'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'4'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'5'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'6'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'7'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'8'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'9'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'0'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; Pattern, 
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;COUNT&lt;/span&gt;(*) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; RecordCount 
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; SampleIDs&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;GROUP&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;REPLACE&lt;/span&gt;(UserIDs, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'1'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'2'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'3'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'4'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'5'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'6'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'7'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'8'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'9'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;), &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'0'&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'_'&lt;/span&gt;)&lt;br&gt;
   &lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   Pattern RecordCount 
   &lt;br&gt;
   ------------------- 
   &lt;br&gt;
   D_____&amp;nbsp; 71680&lt;br&gt;
   _____M&amp;nbsp; 57344&lt;br&gt;
   X____M&amp;nbsp; 14336&lt;br&gt;
   D____M&amp;nbsp; 71680&lt;br&gt;
   X_____&amp;nbsp; 14336&lt;br&gt;
   ______&amp;nbsp; 57344
&lt;/p&gt;
&lt;p&gt;
   With this, we'll simply assume there is an even chance for any of these patterns being
   used on a call.&amp;nbsp; So, D_____ has the probability of 71680/286720 or a 25% chance
   of being provided.&amp;nbsp; Using this information, we can weight the probability of
   this pattern matching an utterance for a user ID.
&lt;/p&gt;
&lt;p&gt;
   First, I run the above SQL statement and put the results into a dataset.&amp;nbsp; You
   can simply create the XML from the recordset, too.&amp;nbsp; My XML results look like
   this:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;records&amp;gt;&lt;br&gt;
   &amp;lt;record&amp;gt;&lt;br&gt;
   &amp;lt;Pattern&amp;gt;D_____&amp;lt;/Pattern&amp;gt;&lt;br&gt;
   &amp;lt;RecordCount&amp;gt;71680&amp;lt;/RecordCount&amp;gt;&lt;br&gt;
   &amp;lt;/record&amp;gt;&lt;br&gt;
   &amp;lt;record&amp;gt;&lt;br&gt;
   &amp;lt;Pattern&amp;gt;_____M&amp;lt;/Pattern&amp;gt;&lt;br&gt;
   &amp;lt;RecordCount&amp;gt;57344&amp;lt;/RecordCount&amp;gt;&lt;br&gt;
   &amp;lt;/record&amp;gt;&lt;br&gt;
   &amp;lt;record&amp;gt;&lt;br&gt;
   &amp;lt;Pattern&amp;gt;X____M&amp;lt;/Pattern&amp;gt;&lt;br&gt;
   &amp;lt;RecordCount&amp;gt;14336&amp;lt;/RecordCount&amp;gt;&lt;br&gt;
   &amp;lt;/record&amp;gt;&lt;br&gt;
   &amp;lt;record&amp;gt;&lt;br&gt;
   &amp;lt;Pattern&amp;gt;D____M&amp;lt;/Pattern&amp;gt;&lt;br&gt;
   &amp;lt;RecordCount&amp;gt;71680&amp;lt;/RecordCount&amp;gt;&lt;br&gt;
   &amp;lt;/record&amp;gt;&lt;br&gt;
   &amp;lt;record&amp;gt;&lt;br&gt;
   &amp;lt;Pattern&amp;gt;X_____&amp;lt;/Pattern&amp;gt;&lt;br&gt;
   &amp;lt;RecordCount&amp;gt;14336&amp;lt;/RecordCount&amp;gt;&lt;br&gt;
   &amp;lt;/record&amp;gt;&lt;br&gt;
   &amp;lt;record&amp;gt;&lt;br&gt;
   &amp;lt;Pattern&amp;gt;______&amp;lt;/Pattern&amp;gt;&lt;br&gt;
   &amp;lt;RecordCount&amp;gt;57344&amp;lt;/RecordCount&amp;gt;&lt;br&gt;
   &amp;lt;/record&amp;gt;&lt;br&gt;
   &amp;lt;/records&amp;gt;&lt;br&gt;
   &lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   Now comes the fun part - using XSLT to create a GRXML grammar file.
&lt;/p&gt;
&lt;p&gt;
   A couple of points about the XSL file:
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      For the JavaScript function buildCharacterArray(s1), you could probably slim the function
      down to "return s1.split('');"&amp;nbsp; It splits a string into a character array. 
   &lt;li&gt;
      XSLT doesn't have a for-each loop, so I recursively call the buildItem template. 
   &lt;li&gt;
      In this example, the TAG is set as an attribute of the related ITEM element.&amp;nbsp;
      For other platforms, this may need to be an element trailing the ITEM element.&amp;nbsp;
      Of course, the tag syntax is different on each platform:( 
   &lt;li&gt;
      In the real world you may find, through transcriptions and tuning, that people may
      utter dashes and spaces, too, or say, "B as in boy."&amp;nbsp; They may also truncate
      leading 0's (00001214V may be spoken 1214V). 
   &lt;li&gt;
      It doesn't handle robust recognition for utterances like "nine double oh one seven"
      or "nine thirty nine twenty two."&amp;nbsp; Unless you find patterns through transcriptions
      and tuning, effectively accommodating this will drop your accuracy and performance
      through the floor. 
   &lt;li&gt;
      Use your web server to cache the GRXML output; there's no need to run it too often.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   The resulting grammar looks like this :&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;?xml
   version=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"1.0"&lt;/span&gt; encoding=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"utf-8"&lt;/span&gt; ?&amp;gt; 
   &lt;br&gt;
   &amp;lt;grammar xml:lang=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"en-US"&lt;/span&gt; version=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"1.0"&lt;/span&gt; root=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"main"&lt;/span&gt; mode=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"voice"&lt;/span&gt; xmlns:msxsl=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"urn:schemas-microsoft-com:xslt"&lt;/span&gt; xmlns:nextivr=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://www.nextivr.com/XSLFunctions"&lt;/span&gt; xmlns:rs=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"urn:schemas-microsoft-com:rowset"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;rule id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"main"&lt;/span&gt; scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"public"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;one-of&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; weight=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0.25"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#D_____"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; weight=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0.2"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#_____M"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; weight=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0.05"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#X____M"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; weight=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0.25"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#D____M"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; weight=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0.05"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#X_____"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; weight=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0.2"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#______"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;/one-of&amp;gt;&lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"D_____"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"D"&lt;/span&gt;&amp;gt;D&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"_____M"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"M"&lt;/span&gt;&amp;gt;M&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"X____M"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"X"&lt;/span&gt;&amp;gt;X&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"M"&lt;/span&gt;&amp;gt;M&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"D____M"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"D"&lt;/span&gt;&amp;gt;D&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"M"&lt;/span&gt;&amp;gt;M&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"X_____"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"X"&lt;/span&gt;&amp;gt;X&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"______"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;ruleref type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/srgs+xml"&lt;/span&gt; uri=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#number"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;rule scope=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"private"&lt;/span&gt; id=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"number"&lt;/span&gt;&amp;gt;&lt;br&gt;
   &amp;lt;one-of&amp;gt;&lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"1"&lt;/span&gt;&amp;gt;one&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"2"&lt;/span&gt;&amp;gt;two&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"3"&lt;/span&gt;&amp;gt;three&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"4"&lt;/span&gt;&amp;gt;four&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"5"&lt;/span&gt;&amp;gt;five&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"6"&lt;/span&gt;&amp;gt;six&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"7"&lt;/span&gt;&amp;gt;seven&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"8"&lt;/span&gt;&amp;gt;eight&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"9"&lt;/span&gt;&amp;gt;nine&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt; tag=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0"&lt;/span&gt;&amp;gt;zero&amp;lt;/&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;item&lt;/span&gt;&amp;gt; 
   &lt;br&gt;
   &amp;lt;/one-of&amp;gt;&lt;br&gt;
   &amp;lt;/rule&amp;gt;&lt;br&gt;
   &amp;lt;/grammar&amp;gt;&lt;br&gt;
   &lt;br&gt;
   &lt;a href="content/binary/AlphaNumIDsToGrammar.zip"&gt;Download the code!&lt;/a&gt;
   &lt;br&gt;
   &lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=fb6fd509-52db-47fa-9dc3-3e343cbc8113" /&gt;</description>
      <comments>http://www.nextivr.com/ericp/CommentView,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.nextivr.com/ericp/Trackback.aspx?guid=9f15277b-bebf-4c17-8181-87eb8ceb7ede</trackback:ping>
      <pingback:server>http://www.nextivr.com/ericp/pingback.aspx</pingback:server>
      <pingback:target>http://www.nextivr.com/ericp/PermaLink,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx</pingback:target>
      <dc:creator>ericp@nextivr.com (Eric Phetteplace)</dc:creator>
      <wfw:comment>http://www.nextivr.com/ericp/CommentView,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx</wfw:comment>
      <wfw:commentRss>http://www.nextivr.com/ericp/SyndicationService.asmx/GetEntryCommentsRss?guid=9f15277b-bebf-4c17-8181-87eb8ceb7ede</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I needed to add some simple, free FAX functionality to an application, so I invested
      a little time in doing it with <a href="http://msdn.microsoft.com/vstudio/express">Visual
      C# 2005 Express Edition</a>. 
   </p>
        <p>
      Source from the web: 
      <br /><a href="http://www.nextivr.com/ericp/content/binary/news.google.com.JPG"><img style="WIDTH: 33.11%; HEIGHT: 78.13%" src="http://www.nextivr.com/ericp/content/binary/news.google.com.JPG" border="0" /></a><br />
      Resulting image: 
      <br /><a href="http://www.nextivr.com/ericp/content/binary/news.google.com.gif"><img style="WIDTH: 33.11%; HEIGHT: 78.13%" src="http://www.nextivr.com/ericp/content/binary/news.google.com.gif" border="0" /></a></p>
        <p>
      I decided to make it use web browser content; seeing that it's pretty easy to format
      a web page, no FAX imaging tools are required. Thanks to <a href="http://www.codeproject.com/script/Articles/list_articles.asp?userid=564301">Michael
      McCloskey's</a>  Bitonal article <a href="http://www.codeproject.com/cs/media/BitonalImageConverter.asp">Bitonal
      (TIFF) Image Converter for .NET</a>, I was able to accomplish my goal rather easily! 
   </p>
        <p>
      I added in some random dithering to produce a decent balance between text pages and
      pages with images. I was tempted to implement <a href="http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_steinberg_dithering.html">Floyd-Steinberg
      Dithering</a>, but my random results are good enough for my project. 
   </p>
        <p>
      I also added in code for generating the image from a web page, and creating the multi-page
      TIFF document.
   </p>
        <p>
      I reference FaxComEx.dll, the Windows FAX server, in the code.  This makes it
      easy to generate a FAX by the command line, <em>(e.g. <u>Url2Fax http://localhost/reportapp/report.jsp?repnum=1
      18885551212 FAXSVR100 will send a report to 8885551212, using the fax printer on FAXSVR100
      (don't use "localhost")</u>)</em>   If you don't want to use the FAX service,
      leave off the parameters.  You can grab the image from your %TEMP% directory.
   </p>
        <p>
      Here's the source code: <a href="http://www.nextivr.com/ericp/content/binary/Url2Fax.zip">Url2Fax.zip</a>. 
      The exe is located in the release folder, in case you want to try it as is. 
      You'll need Windows XP or 2003 to use the built-in Fax delivery.  For Windows
      2000, you can generate the image and then send it with the Windows 2000 fax server.
      (I have a script for that, too).
   </p>
        <p>
          <br />
      Enjoy! 
   </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=9f15277b-bebf-4c17-8181-87eb8ceb7ede" />
      </body>
      <title>Url2Fax, free FAX software with source code, converting web pages to FAX documents.</title>
      <guid>http://www.nextivr.com/ericp/PermaLink,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx</guid>
      <link>http://www.nextivr.com/ericp/PermaLink,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx</link>
      <pubDate>Fri, 11 May 2007 15:21:20 GMT</pubDate>
      <description>&lt;p&gt;
   I needed to add some simple, free FAX functionality to an application, so I invested
   a little time in doing it with &lt;a href="http://msdn.microsoft.com/vstudio/express"&gt;Visual
   C# 2005 Express Edition&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
   Source from the web: 
   &lt;br&gt;
   &lt;a href="http://www.nextivr.com/ericp/content/binary/news.google.com.JPG"&gt;&lt;img style="WIDTH: 33.11%; HEIGHT: 78.13%" src="http://www.nextivr.com/ericp/content/binary/news.google.com.JPG" border=0&gt;&lt;/a&gt; 
   &lt;br&gt;
   Resulting image: 
   &lt;br&gt;
   &lt;a href="http://www.nextivr.com/ericp/content/binary/news.google.com.gif"&gt;&lt;img style="WIDTH: 33.11%; HEIGHT: 78.13%" src="http://www.nextivr.com/ericp/content/binary/news.google.com.gif" border=0&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
   I decided to make it use web browser content; seeing that it's pretty easy to format
   a web page, no FAX imaging tools are required. Thanks to &lt;a href="http://www.codeproject.com/script/Articles/list_articles.asp?userid=564301"&gt;Michael
   McCloskey's&lt;/a&gt;&amp;nbsp; Bitonal article &lt;a href="http://www.codeproject.com/cs/media/BitonalImageConverter.asp"&gt;Bitonal
   (TIFF) Image Converter for .NET&lt;/a&gt;, I was able to accomplish my goal rather easily! 
&lt;/p&gt;
&lt;p&gt;
   I added in some random dithering to produce a decent balance between text pages and
   pages with images. I was tempted to implement &lt;a href="http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_steinberg_dithering.html"&gt;Floyd-Steinberg
   Dithering&lt;/a&gt;, but my random results are good enough for my project. 
&lt;/p&gt;
&lt;p&gt;
   I also added in code for generating the image from a web page, and creating the multi-page
   TIFF document.
&lt;/p&gt;
&lt;p&gt;
   I reference FaxComEx.dll, the Windows FAX server, in the code.&amp;nbsp; This makes it
   easy to generate a FAX by the command line, &lt;em&gt;(e.g. &lt;u&gt;Url2Fax http://localhost/reportapp/report.jsp?repnum=1
   18885551212 FAXSVR100 will send a report to 8885551212, using the fax printer on FAXSVR100
   (don't use "localhost")&lt;/u&gt;)&lt;/em&gt;&amp;nbsp;&amp;nbsp; If you don't want to use the FAX service,
   leave off the parameters.&amp;nbsp; You can grab the image from your %TEMP% directory.
&lt;/p&gt;
&lt;p&gt;
   Here's the source code: &lt;a href="http://www.nextivr.com/ericp/content/binary/Url2Fax.zip"&gt;Url2Fax.zip&lt;/a&gt;.&amp;nbsp;
   The exe is located in the release folder, in case you want to try it as is.&amp;nbsp;
   You'll need Windows XP or 2003 to use the built-in Fax delivery.&amp;nbsp; For Windows
   2000, you can generate the image and then send it with the Windows 2000 fax server.
   (I have a script for that, too).
&lt;/p&gt;
&lt;p&gt;
   &lt;br&gt;
   Enjoy! 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=9f15277b-bebf-4c17-8181-87eb8ceb7ede" /&gt;</description>
      <comments>http://www.nextivr.com/ericp/CommentView,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.nextivr.com/ericp/Trackback.aspx?guid=953266f9-21db-45ae-bb08-9c524b6edfd4</trackback:ping>
      <pingback:server>http://www.nextivr.com/ericp/pingback.aspx</pingback:server>
      <pingback:target>http://www.nextivr.com/ericp/PermaLink,guid,953266f9-21db-45ae-bb08-9c524b6edfd4.aspx</pingback:target>
      <dc:creator>ericp@nextivr.com (Eric Phetteplace)</dc:creator>
      <wfw:comment>http://www.nextivr.com/ericp/CommentView,guid,953266f9-21db-45ae-bb08-9c524b6edfd4.aspx</wfw:comment>
      <wfw:commentRss>http://www.nextivr.com/ericp/SyndicationService.asmx/GetEntryCommentsRss?guid=953266f9-21db-45ae-bb08-9c524b6edfd4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      One of the fundamental tasks in creating speech applications is building the grammars
      for automated speech recognition (ASR).  This entry features techniques to make
      your grammar-building code fast, efficient and maintainable.
   </p>
        <p>
      In many situations, it is unrealistic to design and build your grammars in development
      and deploy them as static grammars in production.  For example, if you are writing
      an address verification application, you may want to ask the caller for the state,
      then the city, then the street and so on.  Instead of building many grammars
      (all the streets in each city, all the cities in each state), you may want to let
      the user activity decide which of the most popular cities have their street grammars
      created, and the most popular states have their city grammars cached, too, and so
      on. 
   </p>
        <p>
      I tried three methods for performing this task.  In all the examples, I connected
      to a database to retrieve choices for the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f5">grammar</a>.<br />
      In the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f1">first example</a>,
      I wrote directly to a stream, writing the xml using strings.  In the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f2">next
      example</a>, I used an XML dataset and an <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f4">XSL
      stylesheet</a> to transform the data to a grammar.  In the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f3">third
      example</a>, I did the same as the second example, but I sent the results directly
      to a Response stream in ASP.NET.  Figures 1, 2 and 3 repsectively provide samples
      of the code.
   </p>
        <p>
      All 3 performed well.  Using a simple performance measurement of the total processor
      time used, they were all a fraction of a second.  The top performer by far was
      using ASP.NET and the response stream.  Of course, IO is the performance killer
      for the first two; writing the file to a disk address is slow compared to writing
      to a memory address.
   </p>
        <h5>Total seconds of processor time.
   </h5>
        <table border="1">
          <tbody>
            <tr>
              <td bgcolor="#cccccc">
              </td>
              <td bgcolor="#aaaaaa" colspan="3">
               Code sample</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               Grammar Items</td>
              <td bgcolor="#aaaaaa">
               Code 1</td>
              <td bgcolor="#aaaaaa">
               Code 2</td>
              <td bgcolor="#aaaaaa">
               Code 3</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               10</td>
              <td>
               0.891</td>
              <td>
               0.938</td>
              <td>
               0.000!</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               100</td>
              <td>
               0.906</td>
              <td>
               0.984</td>
              <td>
               0.012</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               1000</td>
              <td>
               0.938</td>
              <td>
               1.141</td>
              <td>
               0.141</td>
            </tr>
          </tbody>
        </table>
        <p>
          <br />
      So of course, I suggest you use the code in Figure 3.  Here are some tips on
      why I think you should prefer it over the code in Figure 1.
   </p>
        <ul>
          <li>
         If you need to customize the grammar, you can change the XSL file without recompiling
         the code.  Let's say you need to change the TAG element in the grammar (and for
         each VoiceXML platform, tags are implemented differently!), you can adjust the XSL
         file and see visually how you're affecting the grammar. 
      </li>
          <li>
         By using the XML from the DataSet, you don't have to worry about data types as they're
         all converted to text.  If a database field changes in size or precision, the
         code still works without recompiling. 
      </li>
          <li>
         XSL is easier to read.  Mind you, to master it takes some work, but which code
         is easier for an IVR programmer to pick up...<br /><u>This:</u>               
         <p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">while</span>(TestDataReader.Read())<br />
            {<br />
            TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;item&gt;{0}&lt;/item&gt;&lt;tag&gt;colorid
            = {1};&lt;/tag&gt;"</span>, TestDataReader.GetString(1), TestDataReader.GetInt32(0));<br />
            } </span><br /><u>Or this?</u><br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;xsl:<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">each</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">select</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"//record"</span>&gt;<br />
            &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;&lt;xsl:value-of <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">select</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"description"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt;&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;&lt;tag&gt;colorid <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> &lt;xsl:value-of <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">select</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"id"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt;;&lt;/tag&gt; 
            <br />
            &lt;/xsl:<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">each</span>&gt;<br /></span></p></li>
          <li>
         Using Page Output Caching <a href="http://msdn2.microsoft.com/en-us/library/ms972362.aspx">http://msdn2.microsoft.com/en-us/library/ms972362.aspx</a> you
         can get great performance from the dynamic grammars.  Cache the files fresh every
         day, based on the URL parameters.  Schedule a task to call the common URLs, so
         the first caller of the day doesn't have to wait for the first compile (even though
         it's a fraction of a second).  Cache based on a database dependency - there's
         examples out there on how to do this. 
      </li>
          <li>
         Use web.config to store the SQL queries and XSL file names.  That'll make this
         code grammar builder really flexible.</li>
        </ul>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
       <u>In web.config</u><br />
       &lt;configuration&gt;<br />
        &lt;appSettings&gt;<br />
         &lt;add key="colors" value="SELECT id, description FROM colors"
      /&gt;<br />
         &lt;add key="colorsxsl" value="SimpleGrammarTransformer.xsl" /&gt;
   </p>
          <p>
       <u>In your code replace the SQL query with the following:<br /></u>  System.Configuration.ConfigurationSettings.AppSettings[Request.QueryString.Get("grammar_id")]
   </p>
          <p>
            <u> URL to get the colors grammar: </u>
            <br />
        <a href="http://servername/BuildGrammar?grammar_id=colors">http://servername/BuildGrammar?grammar_id=colors</a></p>
        </blockquote>
        <ul>
          <li>
         Use a SCRIPT block in the XSL to manipulate the data, instead of doing it in the compiled
         code.  Using script makes it easy to perform Javascript on the XML as it's being
         processed by the XSL stylesheet.  I've used Javascript to parse comma-delimited
         strings into grammar items, clean up data, and more.  Perhaps if you need an
         example, I can post one...</li>
        </ul>
        <p>
      In conclusion, you should use ASP.NET and XSLT to create your dynamic grammars. 
      It's fast, flexible and easy.  Let me know what you think.  Should I include
      a download, or can you take if from here?
   </p>
        <p>
      Have fun!
   </p>
        <p>
          <a name="f1">
            <strong>Figure 1 - Reading from a DB, writing strings to a stream<br /></strong>
          </a>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
      args)<br />
      {<br />
      TimeSpan TS1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      MySqlConnection DatabaseConnection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlConnection(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Database=;Data
      Source=;User Id=;Password="</span>);<br />
      DatabaseConnection.Open();<br />
      MySqlCommand TestCommand <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlCommand(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SELECT
      id, description FROM colors"</span>, DatabaseConnection);<br />
      MySql.Data.MySqlClient.MySqlDataReader TestDataReader <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> TestCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);<br />
      System.IO.StreamWriter TestWriter <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.IO.StreamWriter(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c:\\temp\\Grammar2.grxml"</span>);<br /><br />
      TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;?xml
      version=\"1.0\" encoding=\"utf-8\"?&gt;&lt;grammar mode=\"voice\" version=\"1.0\"
      root=\"main\"&gt;&lt;rule id=\"main\"&gt;&lt;one-of&gt;"</span>);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (TestDataReader.HasRows)<br />
      {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">while</span>(TestDataReader.Read())<br />
      {<br />
      TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;item&gt;{0}&lt;/item&gt;&lt;tag&gt;colorid
      = {1};&lt;/tag&gt;"</span>, TestDataReader.GetString(1), TestDataReader.GetInt32(0));<br />
      } 
      <br /><br />
      }<br /><br />
      TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;/one-of&gt;&lt;/rule&gt;&lt;/grammar&gt;"</span>);<br />
      TestWriter.Close();<br /><br />
      TimeSpan TS2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br />
      Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Done.
      Total ticks = {0}."</span>, TS2.Subtract(TS1).Ticks.ToString());<br />
      Console.ReadLine();<br /><br />
      }<br /></span>
        </p>
        <a name="f2">
          <p>
            <strong>Figure 2 - Reading from a DB to a DataSet, then transforming with XSLT.<br /></strong>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span>
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
      args)<br />
      {<br />
      TimeSpan TS1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      MySqlConnection DatabaseConnection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlConnection(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Database=;Data
      Source=;User Id=;Password="</span>);<br />
      MySqlDataAdapter DataAdapter <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlDataAdapter(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SELECT
      id, description FROM colors"</span>, DatabaseConnection);<br />
      System.Data.DataSet DBDataSet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Data.DataSet();<br />
      DataAdapter.Fill(DBDataSet, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"record"</span>);<br />
      XmlDocument XMLTarget <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlDocument();<br />
      XMLTarget.LoadXml(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;records&gt;"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> DBDataSet.GetXml() <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;/records&gt;"</span>);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> XmlTempFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c:\\temp\\temprecords.xml"</span>;<br />
      XMLTarget.Save(XmlTempFile);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> XslFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"file://c:/temp/SimpleGrammarTransformer.xsl"</span>;<br />
      System.Xml.Xsl.XslTransform StyleSheet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Xml.Xsl.XslTransform();<br />
      XmlUrlResolver URLResolver <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlUrlResolver();<br />
      StyleSheet.Load(XslFile);<br />
      StyleSheet.Transform(XmlTempFile, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c:\\temp\\Grammar1.grxml"</span>);<br /><br />
      TimeSpan TS2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br />
      Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Done.
      Total ticks = {0}."</span>, TS2.Subtract(TS1).Ticks.ToString());<br />
      Console.ReadLine();<br />
      }<br /><br /></span>
          </p>
          <a name="f3">
            <p>
              <strong>Figure 3 - Reading from a DB and transforming the results to the response
      stream.<br /></strong>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;%@
      Page Language=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c#"</span> AutoEventWireup=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"false"</span> Debug=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"true"</span> %&gt;&lt;%@
      Import <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"System.Xml"</span>%&gt;&lt;%@
      Import <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"MySql.Data.MySqlClient"</span>%&gt;&lt;%<br /><br />
      TimeSpan TS1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      MySqlConnection DatabaseConnection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlConnection(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Database=;Data
      Source=;User Id=;Password="</span>);<br />
      MySqlDataAdapter DataAdapter <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlDataAdapter(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SELECT
      id, description FROM colors"</span>, DatabaseConnection);<br />
      System.Data.DataSet DBDataSet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Data.DataSet();<br />
      DataAdapter.Fill(DBDataSet, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"record"</span>);<br />
      XmlDocument XMLTarget <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlDocument();<br />
      XMLTarget.LoadXml(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;records&gt;"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> DBDataSet.GetXml() <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;/records&gt;"</span>);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> XslFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> String.Format(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"file://{0}"</span>,
      Server.MapPath(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SimpleGrammarTransformer.xsl"</span>)).Replace(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"\\"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"/"</span>);<br />
      System.Xml.Xsl.XslTransform StyleSheet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Xml.Xsl.XslTransform();<br />
      XmlUrlResolver URLResolver <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlUrlResolver();<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//StyleSheet.Load(XslFile,
      URLResolver);</span><br />
      StyleSheet.Load(XslFile, URLResolver);<br /><br />
      StyleSheet.Transform(XMLTarget, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>,
      Response.OutputStream, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>);<br /><br />
      TimeSpan TS2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      Response.Write(String.Format(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;!--Done.
      Total ticks = {0} .--&gt;"</span>, TS2.Subtract(TS1).Ticks.ToString()));<br /><br />
      %&gt;<br /></span>
            </p>
            <a name="f4">
              <p>
                <strong>Figure 4 - An XSLT file for building GRXML grammars</strong>
              </p>
              <p>
      You can always change this so it outputs ABNF, or any GSL.
   </p>
              <p>
                <br />
      &lt;?xml version="1.0"?&gt;<br />
      &lt;xsl:stylesheet version="1.0" 
      <br />
        xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>" 
      <br />
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"<br />
        exclude-result-prefixes="msxsl"<br />
      &gt;<br />
      &lt;xsl:output method="xml"/&gt;<br />
        &lt;xsl:template match="/"&gt;<br />
          &lt;grammar mode="voice" version="1.0" root="main" &gt;<br />
            &lt;rule id="main"&gt;<br />
              &lt;one-of&gt;<br />
                &lt;xsl:for-each select="//record"&gt;<br />
                  &lt;item&gt;&lt;xsl:value-of
      select="description"/&gt;&lt;/item&gt;&lt;tag&gt;colorid = &lt;xsl:value-of select="id"/&gt;;&lt;/tag&gt;          
      <br />
                &lt;/xsl:for-each&gt;<br />
              &lt;/one-of&gt;<br />
            &lt;/rule&gt;<br />
          &lt;/grammar&gt;<br />
        &lt;/xsl:template&gt;<br />
      &lt;/xsl:stylesheet&gt;
   </p>
              <p>
                <br />
                <strong>Figure 5 - GRXML result<br /></strong>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
      &lt;grammar mode="voice" version="1.0" root="main"&gt;<br />
        &lt;rule id="main"&gt;<br />
        &lt;one-of&gt;<br />
          &lt;item&gt;red&lt;/item&gt;&lt;tag&gt;colorid = 1;&lt;/tag&gt;<br />
          &lt;item&gt;orange&lt;/item&gt;&lt;tag&gt;colorid = 2;&lt;/tag&gt;<br />
          &lt;item&gt;yellow&lt;/item&gt;&lt;tag&gt;colorid = 3;&lt;/tag&gt;<br />
          .<br />
          .<br />
          .    
      <br />
        &lt;/one-of&gt;<br />
        &lt;/rule&gt;<br />
      &lt;/grammar&gt;
   </p>
              <p>
       
   </p>
              <font face="Courier New" color="#000000">
              </font>
              <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=953266f9-21db-45ae-bb08-9c524b6edfd4" />
            </a>
          </a>
        </a>
      </body>
      <title>Creating Dynamic GRXML Grammars with c# and ASP.NET</title>
      <guid>http://www.nextivr.com/ericp/PermaLink,guid,953266f9-21db-45ae-bb08-9c524b6edfd4.aspx</guid>
      <link>http://www.nextivr.com/ericp/PermaLink,guid,953266f9-21db-45ae-bb08-9c524b6edfd4.aspx</link>
      <pubDate>Wed, 02 May 2007 23:58:11 GMT</pubDate>
      <description>&lt;p&gt;
   One of the fundamental tasks in creating speech applications is building the grammars
   for automated speech recognition (ASR).&amp;nbsp; This entry features techniques to make
   your grammar-building code fast, efficient and maintainable.
&lt;/p&gt;
&lt;p&gt;
   In many situations, it is unrealistic to design and build your grammars in development
   and deploy them as static grammars in production.&amp;nbsp; For example, if you are writing
   an address verification application, you may want to ask the caller for the state,
   then the city, then the street and so on.&amp;nbsp; Instead of building many grammars
   (all the streets in each city, all the cities in each state), you may want to let
   the user activity decide which of the most popular cities have their street grammars
   created, and the most popular states have their city grammars cached, too, and so
   on. 
&lt;/p&gt;
&lt;p&gt;
   I tried three methods for performing this task.&amp;nbsp; In all the examples, I connected
   to a database to retrieve choices for the &lt;a href="http://www.nextivr.com/ericp/EditEntry.aspx#f5"&gt;grammar&lt;/a&gt;.&lt;br&gt;
   In the &lt;a href="http://www.nextivr.com/ericp/EditEntry.aspx#f1"&gt;first example&lt;/a&gt;,
   I wrote directly to a stream, writing the xml using strings.&amp;nbsp; In the &lt;a href="http://www.nextivr.com/ericp/EditEntry.aspx#f2"&gt;next
   example&lt;/a&gt;, I used 