65,186
社区成员




soap_QName2s(struct soap *soap, const char *s)
{ struct Namespace *p;
char *t;
int n;
if (!s || *s != '"')
{
#ifndef WITH_LEAN
if (s && (soap->mode & SOAP_XML_CANONICAL))
{ t = strchr(s, ':');//这里提示错误
if (t)
soap_utilize_ns(soap, s, t - s);
}
#endif
return s;
}
struct Namespace *p;
char *t;
int n;
if (!s || *s != '"')
{
#ifndef WITH_LEAN
if (s && (soap->mode & SOAP_XML_CANONICAL))
{ t = strchr(s, ':');
if (t)
soap_utilize_ns(soap, s, t - s);
}
#endif
return s;
}
#ifndef WITH_LEAN
if (s && (soap->mode & SOAP_XML_CANONICAL))
{t = (char*)strchr(s, ':'); //这里强制转换成char*
if (t)
soap_utilize_ns(soap, s, t - s);
}
#endif
soap_QName2s(struct soap *soap, const char *s)
{ struct Namespace *p;
char* t;
int n;
if (!s || *s != '"')
{
#ifndef WITH_LEAN
if (s && (soap->mode & SOAP_XML_CANONICAL))
{const char *t = strchr(s, ':');
if (t)
soap_utilize_ns(soap, s, t - s);
}
#endif
return s;
}
s++;
if ((p = soap->local_namespaces))
{ for (; p->id; p++)
{ if (p->ns)
if (!soap_tag_cmp(s, p->ns))
break;
if (p->in)
if (!soap_tag_cmp(s, p->in))
break;
}
if (p && p->id)
{ s = strchr(s, '"');
if (s)
{ t = (char*)soap_malloc(soap, strlen(p->id) + strlen(s));
strcpy(t, p->id);
strcat(t, s + 1);
return t;
}
}
}
t = (char*)strchr(s, '"');
if (t)
n = t - s;
else
n = 0;
t = soap_strdup(soap, s);
t[n] = '\0';
sprintf(soap->tmpbuf, "xmlns:_%d", soap->idnum++);
soap_set_attr(soap, soap->tmpbuf, t);
s = strchr(s, '"');
if (s)
{ t = (char*)soap_malloc(soap, strlen(soap->tmpbuf) + strlen(s) - 6);
strcpy(t, soap->tmpbuf + 6);
strcat(t, s + 1);
}
return t;
}
int ch = ':';
const char* t = strchr( s, ch ); //使用const的版本