cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
112
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 07-03-2007 07:47:48 PM
I am creating a custom element that needs to handle a custom grammar tag. Namely, I need to eliminate the xmlns attribute. I cannot find any method within the VGrammar class that will allow me to do this. I can set (or unset) all other values. How would I accomplish this?

I am using Call Services 3.6 and VoiceGenie 7 with Nuance 8.5. I'm trying to generate a grammar that looks like this:

[code:1:cea4f24ae9]
grammar type="application/x-voicegenie-nuance" xml:lang="en-US-1">
<!&#91;CDATA&#91;
;GSL2.0
ROOT&#58;public&#40;<static>&#41;
&#93;&#93;>
</grammar>
[/code:1:cea4f24ae9]
[i:cea4f24ae9]I've intentionally left off the leading less-than sign from the grammar for display purposes.[/i:cea4f24ae9]

Subject: RE: Grammar xmlns attribute
Replied by: null on 09-03-2007 08:53:50 PM
Hi Joel,

You can not eliminate the "xmlns" attribute in a custom grammar tag from within the VGrammar class. The "xmlns" attribute is automatically added by the VoiceGenie 7 with Nuance 8.5 Gateway Adapter since the default grammar type is SRGS and that attribute is required for SRGS grammars on this browser. If you choose to use other grammar types then you can use an external grammar with the same content as you would use for your custom inline grammar. This would solve the problem since you can leave out the "xmlns" attribute from the external grammar.

Hope this helps,
Roberto

Subject: RE: Grammar xmlns attribute
Replied by: null on 13-03-2007 07:58:05 PM
Unfortunately, this cannot be an external grammar; the code must be embedded within the VXML as an inline grammar. Is there a way to turn off the default behavior for a grammar?

Subject: RE: Grammar xmlns attribute
Replied by: null on 14-03-2007 02:45:29 PM
Hello Joel,

Inline grammars that are generated with the Audium software are for the specific gateway they are targeted for. The inline grammars generated with the type="application/srgs_xml" for the VoiceGenie7 with Nuance 8.5 Gateway would require the xmlns attribute. Removing the namespace attribute would impact all applications configured with this Gateway Adapter. The recommended workaround for other grammar types that do not require the namespace attribute is to utilize external grammars.

Regards,
Tam

Subject: RE: Grammar xmlns attribute
Replied by: null on 20-03-2007 03:11:59 PM
I've tried a couple things and leaving the xmlns and mode attributes in seems to work, but apparently whitespace within the CDATA is important for our system. I have the following line in my Java code:

[code:1:336c7b0a3e]grammar.setSpeechInline&#40;"\n;GSL2.0\nROOT&#58;public&#40;<static>&#41;\n",true&#41;;[/code:1:336c7b0a3e]
Unfortunately, putting leading and trailing newlines or spaces wonâ¿¿t work. Audium seemingly does a String.trim() on the string passed in which eliminates leading and trailing whitespace (i.e. anything that has an ASCII value less than or equal to â¿¿spaceâ¿¿). This includes newlines and spacing.

Is there a way around this so I can preserve the spacing?

Subject: RE: Grammar xmlns attribute
Replied by: null on 20-03-2007 07:03:16 PM
Hi Joel,

Could you please give us more detailed information about putting leading and trailing newlines or spaces? we do not call String.trim() on the string passed in VGrammar.setSpeechInline(String content, boolean includeInCDATA). Based on our test, we were able to include a leading space in the inline grammar by calling the setSpeechInline method.

Thank you,

Hong

Subject: RE: Grammar xmlns attribute
Replied by: null on 20-03-2007 07:25:14 PM
When I have the command:
[code:1:5b606366f5]grammar.setSpeechInline&#40;"\n;GSL2.0\nROOT&#58;public&#40;<static>&#41;\n",true&#41;;[/code:1:5b606366f5]
I get the following VXML:
[code:1:5b606366f5]grammar xmlns="http&#58;//www.w3.org/2001/06/grammar" mode="voice" type="application/x-voicegenie-nuance" xml&#58;lang="en-US-1"><!&#91;CDATA&#91;;GSL2.0
ROOT&#58;public&#40;<static>&#41;&#93;&#93;></grammar>[/code:1:5b606366f5]

But yet, when I have:
[code:1:5b606366f5]grammar.setSpeechInline&#40;". \n;GSL2.0\nROOT&#58;public&#40;<static>&#41;\n .",true&#41;;[/code:1:5b606366f5]
I get the following VXML:
[code:1:5b606366f5]grammar xmlns="http&#58;//www.w3.org/2001/06/grammar" mode="voice" type="application/x-voicegenie-nuance" xml&#58;lang="en-US-1"><!&#91;CDATA&#91;.
;GSL2.0
ROOT&#58;public&#40;<static>&#41;
.&#93;&#93;></grammar>[/code:1:5b606366f5]

As you can see, the leading and trailing newlines in the first example are eliminated. This seems to be caused by String.trim()'s output, but I may be wrong. I am using CallServices 3.6, but I don't think the latest patch 10 if that makes a difference.

[i:5b606366f5]FYI, this isn't a problem per se as I found that my issue is being caused by the universal help grammar being active at the same, but I wanted to bring it up.[/i:5b606366f5]

Subject: RE: Grammar xmlns attribute
Replied by: null on 21-03-2007 04:15:46 PM
Hi Joel,

Could you tell us what tools (Firefox or Notepad) you use to open the VXML source code? Based on our test, the leading and trailing newlines or spaces will disappear when we use Firefox to open a VXML source file, but they will not disappear when we use Notepad to open it.

Regards,

Hong

Subject: RE: Grammar xmlns attribute
Replied by: null on 21-03-2007 05:42:05 PM
I added the MyDebugLogger to by logging classes via the KB article http://kb.audiumcentral.com/questions/258/q

I then opened the resulting ouput file in either Notepad or VIM.

Subject: RE: Grammar xmlns attribute
Replied by: null on 21-03-2007 09:16:51 PM
Hi Joel,

Thank you for taking the time to provide us with this example. We have added this enhancement request to our internal issue-tracking system with an ID of CSCsi21049. Should you wish to track the status of this request in the future, please refer to that ID.

Regards,

Hong
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links