vxi-discuss



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: bug in osOpenHttpUrl()



What I've seen is that URI's that are built like this:
    <goto next=http://server/path?name=value&name=value/>
 
don't work because xerces chokes on the & itself.
 
For example, I tried the following
 
         <form id="menu"> 
         <block><goto next="http://bubble/vxml/test16.vxml?lang=fr&tech=machin"/></block>
         </form>
 
While stepping through the execution with the debugger, I see the following call sequence:
 VXI::block_element()  calls into VXI::execute_content(),  which then fails to see the <goto> element at all.  If I remove the '&tech=machin' option, it
works fine, execute_content() finds the <goto> element. 
I tried to build the URI with an expression like  "'http://bubble/vxml/test16.vxml' + '?lang=fr' + '&tech=machin'" and it failed too. 
I then replaced the & with a ; and it worked ok.  Looks like the & is causing some internal distress.
 
-ken

-----Original Message-----
From: Jean-Michel Reghem [mailto:jeanmichel.reghem@planetinternet.be]
Sent: Friday, August 10, 2001 10:55 AM
To: vxi-discuss@metronomicon.com
Subject: RE: bug in osOpenHttpUrl()

John Kerwin écrivait ( Friday 8/10/01 10:34 AM ) dans le message ci-dessous:
---
My patch was for the <grammar> tag and not the <goto> tag.  

OK ... i was believing you wanted to patch all http connexion ... sorry

Is there any reason to have an anchor '#' in a grammar tag?

no ;-))


As for the goto, the following worked (the gotest.jsp had two forms, one named moose and one named bad)
<goto next="gototest.jsp?dog=snoopy#moose/>  <- went to moose
and
<goto next="gototest.jsp#moose/> <- went to moose
and
<goto next="gototest.jsp?dog=snoopy/> <- went to bad (which was correct)
 
what didn't work was
<goto next="gototest.jsp?dog=snoopy&cat=kitty#moose/> 


i'm agree with you...
but for 1 , can you got dog variable or openVXI translate  gototest.jsp?dog=snoopy#moose in gototest.jsp#moose?


any suggestions?

No ... if it's working for goto or submit with you patch, then it's good... you add a functionnality...

have you try submit?

CU
Jean-Michel

 
 -----Original Message-----
From: vxi-discuss@metronomicon.com [mailto:vxi-discuss@metronomicon.com]On Behalf Of Jean-Michel Reghem
Sent: Friday, August 10, 2001 6:48 AM
To: vxi-discuss@metronomicon.com
Subject: RE: bug in osOpenHttpUrl()
John Kerwin écrivait ( Wednesday 8/1/01 06:49 PM ) dans le message ci-dessous:
---
Yes, it's true it don't work for goto tag...
i try this
<goto next="http://bubble/vxml/test16.vxml?lang=fr"/>

i get bad fetch (it's normal) but in my appache access log, i get http://bubble/vxml/test16.vxml and not http://bubble/vxml/test16.vxml?lang=fr

i try this:

<goto next="http://bubble/vxml/test16.vxml#lang"/>
idem than http://bubble/vxml/test16.vxml?lang=fr

i try this
<goto next="http://bubble/vxml/test16.vxml?lang=fr&truc=machin"/>
i got an error: VXI abort and return NULL
--> thus there is an error with &

i try this
<goto expr="'http://bubble/vxml/test16.vxml' + '?lang=fr' + '&truc=machin'"/>

and i got the same problem ;-))



Well it was a lot easier to fix then I thought:
i'm going to try you patch ... but (see further in the code...)



There are two parts to the fix

Part I (one change).  Concatenate the "extra information" to the end of the
querystring

  queryStringStr[0] = 0;
  addQueryStringToUrl( queryStringStr, URL_EXTRA_LENGTH, queryObj );
  printf("queryStringStr = %s\n",queryStringStr);

becomes
  queryStringStr[0] = 0;
  addQueryStringToUrl( queryStringStr, URL_EXTRA_LENGTH, queryObj );
  // change 1 or 1 -  this might not be totally correct.  Does not work
  // with anchors (i.e. grammar.jsp#dog), but why would you have these?


because anchors are important in link and goto tag ...
in voiceXML 1.0, you have to use anchors to go to a specified dialog in other document (or in the same document...)

like this:
<goto expr="(type==true) ? 'utilities.vxml#confirm' : 'utilities.vxml#bye' />



Is somebody has a solution to manage ? (and & ) and also  anchors # ???

thank you

  if (VXIstrlen(comp->lpszExtraInfo)>0 && comp->lpszExtraInfo[0]=='?')
  {
        if(VXIstrlen(queryStringStr)>0) // if not first, put in '&'
          VXIstrcat(queryStringStr,"&");
        VXIstrcat(queryStringStr,comp->lpszExtraInfo+1); // skip the '?'
  }
  printf("queryStringStr = %s\n",queryStringStr);







Part II (two changes). Use the extra data (there might NOT be a queryObj
even though there is "extra information")

  if(fetchMethod && (VXIstrcmp(fetchMethod, URL_METHOD_POST) == 0)){
    strcpy(path,comp->lpszUrlPath);
    if(queryObj)
      extra_data = queryStringStr;
    cacheFlag = URL_DO_NOT_CACHE;
  }
  else{
    if(cacheFlag == URL_DO_NOT_CACHE)
      cacheFlag = URL_DO_NOT_CACHE;
    strcpy(path,comp->lpszUrlPath);
    if(queryObj && (VXIstrlen(queryStringStr) > 0)){
      strcat(path,"?");
      strcat(path, queryStringStr);
    }
  }

becomes:
  if(fetchMethod && (VXIstrcmp(fetchMethod, URL_METHOD_POST) == 0)){
    strcpy(path,comp->lpszUrlPath);
    // CHANGE 1 OF 2
    //if(queryObj)
      extra_data = queryStringStr;
    cacheFlag = URL_DO_NOT_CACHE;
  }
  else{
    if(cacheFlag == URL_DO_NOT_CACHE)
      cacheFlag = URL_DO_NOT_CACHE;
    strcpy(path,comp->lpszUrlPath);
    // CHANGE 2 OF 2
    if(/*queryObj && */(VXIstrlen(queryStringStr) > 0)){
      strcat(path,"?");
      strcat(path, queryStringStr);
    }
  }

-----Original Message-----
From: John Kerwin [mailto:johnkerwin2001@yahoo.com]
Sent: Wednesday, August 01, 2001 6:15 PM
To: vxi-discuss@metronomicon.com
Subject: bug in osOpenHttpUrl()



osOpenHttpUrl() ignores the "extra" information that is in the url.

extra, as defined by microsoft's InternetCrackURL is
"extra information (for example, ?something or #something)"



so if I have a grammar

<grammar src="http://yahoo.com?spanish=t"/>  I only get <grammar
src="http://yahoo.com"/>

Anyone have a fix for this before I go and do it myself?



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
---
---



This page is maintained by Alan W Black (awb@cs.cmu.edu)
speechinfo.org is hosted on a machine donated by VA Linux Systems
VA Linux Systems