Hi, I supose if I try what you say it will work. However, I only need
the attribute
'xmlns:sapi="
http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
' to say to the grammar compiler to use some extension to build the
binary file of the grammar.
Let me show what I need to get, you will see that I don't need a tag
<sapi:whatever ... />.
<grammar xmlns="
http://www.w3.org/2001/06/grammar"
xmlns:sapi="
http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
xml:lang="en-US" tag-format="semantics-ms/1.0" version="1.0"
mode="voice">
<rule id="root" scope="public">
<tag>$.Result={}</tag>
<one-of>
<item>
<item>Boston Fortune</item>
<tag>$.Result.FirstName=Boston</tag>
<tag>$.Result.LastName=Fortune</tag>
<tag>$.Result.Extension=123</tag>
<tag>$.Result.Department=Development</tag>
</item>
<item>
<item>Londo Deamon</item>
<tag>$.Result.FirstName=Londo</tag>
<tag>$.Result.LastName=Deamon</tag>
<tag>$.Result.Extension=456</tag>
<tag>$.Result.Department=Development</tag>
</item>
<item>
<item>Oxford Cowboy</item>
<tag>$.Result.FirstName=Oxford</tag>
<tag>$.Result.LastName=Cowboy</tag>
<tag>$.Result.Extension=789</tag>
<tag>$.Result.Department=Research</tag>
</item>
</one-of>
</rule>
</grammar>
Now I have it working with the following xslt, but I beleive it's a
workaround and not a good solution:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:sapi="
http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
xmlns="
http://www.w3.org/2001/06/grammar">
<xsl
utput method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="/">
<grammar
xmlns:sapi="
http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
xml:lang="en-US" tag-format="semantics-ms/1.0" version="1.0"
mode="voice" xmlns="
http://www.w3.org/2001/06/grammar">
<!--
<xsl:element name="grammar">
<xsl:attribute
name="xmlns">
http://www.w3.org/2001/06/grammar</xsl:attribute>
<xsl:attribute
name="xmlns:sapi">
http://schemas.microsoft.com/Speech/2002/06/SRGSExtens
ions</xsl:attribute>
<xsl:attribute name="xml:lang">en-US</xsl:attribute>
<xsl:attribute name="tag-format">semantics-ms/1.0</xsl:attribute>
<xsl:attribute name="version">1.0</xsl:attribute>
<xsl:attribute name="mode">voice</xsl:attribute>
-->
<xsl:element name="rule">
<xsl:attribute name="id">root</xsl:attribute>
<xsl:attribute name="scope">public</xsl:attribute>
<xsl:call-template name="tag">
<xsl:with-param name="name">$.Result</xsl:with-param>
<xsl:with-param name="value">{}</xsl:with-param>
</xsl:call-template>
<xsl:element name="one-of">
<xsl:for-each select="//User">
<xsl:call-template name="user" />
</xsl:for-each>
</xsl:element>
</xsl:element>
<!--
</xsl:element>
-->
</grammar>
</xsl:template>
<xsl:template name="tag">
<xsl
aram name="name" />
<xsl
aram name="value" />
<xsl:element name="tag">
<xsl:value-of select="$name" />
<xsl:text>=</xsl:text>
<xsl:value-of select="$value" />
</xsl:element>
</xsl:template>
<xsl:template name="user">
<xsl:element name="item">
<xsl:element name="item">
<xsl:value-of select="./FirstName" />
<xsl:text> </xsl:text>
<xsl:value-of select="./LastName" />
</xsl:element>
<xsl:call-template name="tag">
<xsl:with-param name="name">$.Result.FirstName</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="./FirstName"
/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="tag">
<xsl:with-param name="name">$.Result.LastName</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="./LastName"
/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="tag">
<xsl:with-param name="name">$.Result.Extension</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="./Extension"
/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="tag">
<xsl:with-param name="name">$.Result.Department</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="./Department"
/></xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
As you can see, there are some part that are commented becuase they
don't work.
Cheers!