#include "php_soap.h"
#include "libxml/uri.h"
-static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr simpleType, sdlTypePtr cur_type);
-static int schema_complexType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr compType, sdlTypePtr cur_type);
-static int schema_list(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr listType, sdlTypePtr cur_type);
-static int schema_union(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr unionType, sdlTypePtr cur_type);
-static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr simpCompType, sdlTypePtr cur_type);
-static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType);
-static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr restType, sdlTypePtr cur_type);
-static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type);
-static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type);
-static int schema_sequence(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model);
-static int schema_all(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model);
-static int schema_choice(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model);
-static int schema_group(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model);
-static int schema_any(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model);
-static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model);
-static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx);
-static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx);
+static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, sdlTypePtr cur_type);
+static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, sdlTypePtr cur_type);
+static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypePtr cur_type);
+static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTypePtr cur_type);
+static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompType, sdlTypePtr cur_type);
+static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType);
+static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type);
+static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type);
+static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type);
+static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model);
+static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx);
+static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx);
static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valptr);
}
tns = get_attribute(schema->properties, "targetNamespace");
+ if (tns == NULL) {
+ tns = xmlSetProp(schema, "targetNamespace", "");
+ xmlNewNs(schema, "", NULL);
+ }
trav = schema->children;
while (trav != NULL) {
Content: (annotation?, (restriction | list | union))
</simpleType>
*/
-static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr simpleType, sdlTypePtr cur_type)
+static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
xmlAttrPtr name, ns;
ns = get_attribute(simpleType->properties, "targetNamespace");
if (ns == NULL) {
- ns = tsn;
+ ns = tns;
}
name = get_attribute(simpleType->properties, "name");
}
if (trav != NULL) {
if (node_is_equal(trav,"restriction")) {
- schema_restriction_simpleContent(sdl, tsn, trav, cur_type, 1);
+ schema_restriction_simpleContent(sdl, tns, trav, cur_type, 1);
trav = trav->next;
} else if (node_is_equal(trav,"list")) {
cur_type->kind = XSD_TYPEKIND_LIST;
- schema_list(sdl, tsn, trav, cur_type);
+ schema_list(sdl, tns, trav, cur_type);
trav = trav->next;
} else if (node_is_equal(trav,"union")) {
cur_type->kind = XSD_TYPEKIND_UNION;
- schema_union(sdl, tsn, trav, cur_type);
+ schema_union(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in simpleType",trav->name);
Content: (annotation?, (simpleType?))
</list>
*/
-static int schema_list(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr listType, sdlTypePtr cur_type)
+static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
xmlAttrPtr itemType;
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup("anonymous");
- newType->namens = estrdup(tsn->children->content);
+ newType->namens = estrdup(tns->children->content);
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
}
zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
- schema_simpleType(sdl, tsn, trav, newType);
+ schema_simpleType(sdl, tns, trav, newType);
trav = trav->next;
}
if (trav != NULL) {
Content: (annotation?, (simpleType*))
</union>
*/
-static int schema_union(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr unionType, sdlTypePtr cur_type)
+static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
xmlAttrPtr memberTypes;
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup("anonymous");
- newType->namens = estrdup(tsn->children->content);
+ newType->namens = estrdup(tns->children->content);
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
}
zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
- schema_simpleType(sdl, tsn, trav, newType);
+ schema_simpleType(sdl, tns, trav, newType);
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in union",trav->name);
Content: (annotation?, (restriction | extension))
</simpleContent>
*/
-static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr simpCompType, sdlTypePtr cur_type)
+static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
if (trav != NULL) {
if (node_is_equal(trav, "restriction")) {
cur_type->kind = XSD_TYPEKIND_RESTRICTION;
- schema_restriction_simpleContent(sdl, tsn, trav, cur_type, 0);
+ schema_restriction_simpleContent(sdl, tns, trav, cur_type, 0);
trav = trav->next;
} else if (node_is_equal(trav, "extension")) {
cur_type->kind = XSD_TYPEKIND_EXTENSION;
- schema_extension_simpleContent(sdl, tsn, trav, cur_type);
+ schema_extension_simpleContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in simpleContent",trav->name);
Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)?, ((attribute | attributeGroup)*, anyAttribute?))
</restriction>
*/
-static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType)
+static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type, int simpleType)
{
xmlNodePtr trav;
xmlAttrPtr base;
trav = trav->next;
}
if (trav != NULL && node_is_equal(trav, "simpleType")) {
- schema_simpleType(sdl, tsn, trav, cur_type);
+ schema_simpleType(sdl, tns, trav, cur_type);
trav = trav->next;
}
while (trav != NULL) {
if (!simpleType) {
while (trav != NULL) {
if (node_is_equal(trav,"attribute")) {
- schema_attribute(sdl, tsn, trav, cur_type, NULL);
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
- schema_attributeGroup(sdl, tsn, trav, cur_type, NULL);
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
/* TODO: <anyAttribute> support */
trav = trav->next;
Content: (annotation?, (group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))
</restriction>
*/
-static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr restType, sdlTypePtr cur_type)
+static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr restType, sdlTypePtr cur_type)
{
xmlAttrPtr base;
xmlNodePtr trav;
}
if (trav != NULL) {
if (node_is_equal(trav,"group")) {
- schema_group(sdl, tsn, trav, cur_type, NULL);
+ schema_group(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"all")) {
- schema_all(sdl, tsn, trav, cur_type, NULL);
+ schema_all(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"choice")) {
- schema_choice(sdl, tsn, trav, cur_type, NULL);
+ schema_choice(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"sequence")) {
- schema_sequence(sdl, tsn, trav, cur_type, NULL);
+ schema_sequence(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
}
}
while (trav != NULL) {
if (node_is_equal(trav,"attribute")) {
- schema_attribute(sdl, tsn, trav, cur_type, NULL);
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
- schema_attributeGroup(sdl, tsn, trav, cur_type, NULL);
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
/* TODO: <anyAttribute> support */
trav = trav->next;
Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
</extension>
*/
-static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type)
+static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
xmlAttrPtr base;
}
while (trav != NULL) {
if (node_is_equal(trav,"attribute")) {
- schema_attribute(sdl, tsn, trav, cur_type, NULL);
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
- schema_attributeGroup(sdl, tsn, trav, cur_type, NULL);
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
/* TODO: <anyAttribute> support */
trav = trav->next;
Content: (annotation?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))
</extension>
*/
-static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type)
+static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
xmlAttrPtr base;
}
if (trav != NULL) {
if (node_is_equal(trav,"group")) {
- schema_group(sdl, tsn, trav, cur_type, NULL);
+ schema_group(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"all")) {
- schema_all(sdl, tsn, trav, cur_type, NULL);
+ schema_all(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"choice")) {
- schema_choice(sdl, tsn, trav, cur_type, NULL);
+ schema_choice(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"sequence")) {
- schema_sequence(sdl, tsn, trav, cur_type, NULL);
+ schema_sequence(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
}
}
while (trav != NULL) {
if (node_is_equal(trav,"attribute")) {
- schema_attribute(sdl, tsn, trav, cur_type, NULL);
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
- schema_attributeGroup(sdl, tsn, trav, cur_type, NULL);
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
/* TODO: <anyAttribute> support */
trav = trav->next;
Content: (annotation?, element*)
</all>
*/
-static int schema_all(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr all, sdlTypePtr cur_type, sdlContentModelPtr model)
+static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
xmlAttrPtr attr;
}
while (trav != NULL) {
if (node_is_equal(trav,"element")) {
- schema_element(sdl, tsn, trav, cur_type, newModel);
+ schema_element(sdl, tns, trav, cur_type, newModel);
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in all",trav->name);
}
Content: (annotation?)
</group>
*/
-static int schema_group(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model)
+static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
xmlAttrPtr attr;
ns = get_attribute(groupType->properties, "targetNamespace");
if (ns == NULL) {
- ns = tsn;
+ ns = tns;
}
name = get_attribute(groupType->properties, "name");
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has both 'ref' attribute and subcontent");
}
newModel->kind = XSD_CONTENT_CHOICE;
- schema_choice(sdl, tsn, trav, cur_type, newModel);
+ schema_choice(sdl, tns, trav, cur_type, newModel);
trav = trav->next;
} else if (node_is_equal(trav,"sequence")) {
if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has both 'ref' attribute and subcontent");
}
newModel->kind = XSD_CONTENT_SEQUENCE;
- schema_sequence(sdl, tsn, trav, cur_type, newModel);
+ schema_sequence(sdl, tns, trav, cur_type, newModel);
trav = trav->next;
} else if (node_is_equal(trav,"all")) {
if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has both 'ref' attribute and subcontent");
}
newModel->kind = XSD_CONTENT_ALL;
- schema_all(sdl, tsn, trav, cur_type, newModel);
+ schema_all(sdl, tns, trav, cur_type, newModel);
trav = trav->next;
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in group",trav->name);
Content: (annotation?, (element | group | choice | sequence | any)*)
</choice>
*/
-static int schema_choice(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model)
+static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
xmlAttrPtr attr;
}
while (trav != NULL) {
if (node_is_equal(trav,"element")) {
- schema_element(sdl, tsn, trav, cur_type, newModel);
+ schema_element(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"group")) {
- schema_group(sdl, tsn, trav, cur_type, newModel);
+ schema_group(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"choice")) {
- schema_choice(sdl, tsn, trav, cur_type, newModel);
+ schema_choice(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"sequence")) {
- schema_sequence(sdl, tsn, trav, cur_type, newModel);
+ schema_sequence(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"any")) {
- schema_any(sdl, tsn, trav, cur_type, newModel);
+ schema_any(sdl, tns, trav, cur_type, newModel);
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in choice",trav->name);
}
Content: (annotation?, (element | group | choice | sequence | any)*)
</sequence>
*/
-static int schema_sequence(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model)
+static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
xmlAttrPtr attr;
}
while (trav != NULL) {
if (node_is_equal(trav,"element")) {
- schema_element(sdl, tsn, trav, cur_type, newModel);
+ schema_element(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"group")) {
- schema_group(sdl, tsn, trav, cur_type, newModel);
+ schema_group(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"choice")) {
- schema_choice(sdl, tsn, trav, cur_type, newModel);
+ schema_choice(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"sequence")) {
- schema_sequence(sdl, tsn, trav, cur_type, newModel);
+ schema_sequence(sdl, tns, trav, cur_type, newModel);
} else if (node_is_equal(trav,"any")) {
- schema_any(sdl, tsn, trav, cur_type, newModel);
+ schema_any(sdl, tns, trav, cur_type, newModel);
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in sequence",trav->name);
}
return TRUE;
}
-static int schema_any(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model)
+static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr extType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
/* TODO: <any> support */
return TRUE;
Content: (annotation?, (restriction | extension))
</complexContent>
*/
-static int schema_complexContent(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr compCont, sdlTypePtr cur_type)
+static int schema_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compCont, sdlTypePtr cur_type)
{
xmlNodePtr trav;
if (trav != NULL) {
if (node_is_equal(trav, "restriction")) {
cur_type->kind = XSD_TYPEKIND_RESTRICTION;
- schema_restriction_complexContent(sdl, tsn, trav, cur_type);
+ schema_restriction_complexContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else if (node_is_equal(trav, "extension")) {
cur_type->kind = XSD_TYPEKIND_EXTENSION;
- schema_extension_complexContent(sdl, tsn, trav, cur_type);
+ schema_extension_complexContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in complexContent",trav->name);
Content: (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))))
</complexType>
*/
-static int schema_complexType(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr compType, sdlTypePtr cur_type)
+static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, sdlTypePtr cur_type)
{
xmlNodePtr trav;
xmlAttrPtr attrs, name, ns;
attrs = compType->properties;
ns = get_attribute(attrs, "targetNamespace");
if (ns == NULL) {
- ns = tsn;
+ ns = tns;
}
name = get_attribute(attrs, "name");
}
if (trav != NULL) {
if (node_is_equal(trav,"simpleContent")) {
- schema_simpleContent(sdl, tsn, trav, cur_type);
+ schema_simpleContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else if (node_is_equal(trav,"complexContent")) {
- schema_complexContent(sdl, tsn, trav, cur_type);
+ schema_complexContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
if (node_is_equal(trav,"group")) {
- schema_group(sdl, tsn, trav, cur_type, NULL);
+ schema_group(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"all")) {
- schema_all(sdl, tsn, trav, cur_type, NULL);
+ schema_all(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"choice")) {
- schema_choice(sdl, tsn, trav, cur_type, NULL);
+ schema_choice(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
} else if (node_is_equal(trav,"sequence")) {
- schema_sequence(sdl, tsn, trav, cur_type, NULL);
+ schema_sequence(sdl, tns, trav, cur_type, NULL);
trav = trav->next;
}
while (trav != NULL) {
if (node_is_equal(trav,"attribute")) {
- schema_attribute(sdl, tsn, trav, cur_type, NULL);
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
- schema_attributeGroup(sdl, tsn, trav, cur_type, NULL);
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
/* TODO: <anyAttribute> support */
trav = trav->next;
Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
</element>
*/
-static int schema_element(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model)
+static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
xmlAttrPtr attrs, attr, ns, name, type, ref = NULL;
attrs = element->properties;
ns = get_attribute(attrs, "targetNamespace");
if (ns == NULL) {
- ns = tsn;
+ ns = tns;
}
name = get_attribute(attrs, "name");
} else if (type != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype");
}
- schema_simpleType(sdl, tsn, trav, cur_type);
+ schema_simpleType(sdl, tns, trav, cur_type);
trav = trav->next;
} else if (node_is_equal(trav,"complexType")) {
if (ref != NULL) {
} else if (type != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype");
}
- schema_complexType(sdl, tsn, trav, cur_type);
+ schema_complexType(sdl, tns, trav, cur_type);
trav = trav->next;
}
}
Content: (annotation?, (simpleType?))
</attribute>
*/
-static int schema_attribute(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx)
+static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdlTypePtr cur_type, sdlCtx *ctx)
{
sdlAttributePtr newAttr;
xmlAttrPtr attr, name, ref = NULL, type = NULL;
ns = get_attribute(attrType->properties, "targetNamespace");
if (ns == NULL) {
- ns = tsn;
+ ns = tns;
}
if (ns != NULL) {
smart_str_appends(&key, ns->children->content);
dummy_type = emalloc(sizeof(sdlType));
memset(dummy_type, 0, sizeof(sdlType));
dummy_type->name = estrdup("anonymous");
- dummy_type->namens = estrdup(tsn->children->content);
- schema_simpleType(sdl, tsn, trav, dummy_type);
+ dummy_type->namens = estrdup(tns->children->content);
+ schema_simpleType(sdl, tns, trav, dummy_type);
newAttr->encode = dummy_type->encode;
delete_type(&dummy_type);
trav = trav->next;
return TRUE;
}
-static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tsn, xmlNodePtr attrGroup, sdlTypePtr cur_type, sdlCtx *ctx)
+static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGroup, sdlTypePtr cur_type, sdlCtx *ctx)
{
xmlNodePtr trav;
xmlAttrPtr name, ref = NULL;
ns = get_attribute(attrGroup->properties, "targetNamespace");
if (ns == NULL) {
- ns = tsn;
+ ns = tns;
}
newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
}
- schema_attribute(sdl, tsn, trav, cur_type, NULL);
+ schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
}
- schema_attributeGroup(sdl, tsn, trav, cur_type, NULL);
+ schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");