summaryrefslogtreecommitdiffstats
path: root/xsd2c/formatter.c
diff options
context:
space:
mode:
Diffstat (limited to 'xsd2c/formatter.c')
-rw-r--r--xsd2c/formatter.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/xsd2c/formatter.c b/xsd2c/formatter.c
index 50b81f9..0d46f11 100644
--- a/xsd2c/formatter.c
+++ b/xsd2c/formatter.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: formatter.c,v 1.2 2004/06/03 13:14:35 snowdrop Exp $
+ * $Id: formatter.c,v 1.3 2004/06/03 20:23:02 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -75,6 +75,7 @@ void writeComplexTypeHeaderFile(FILE* f, HCOMPLEXTYPE obj)
HFIELD field;
char buffer[1054];
+
if (obj == NULL)
{
fprintf(stderr, "Can not declare a null object!\n");
@@ -91,14 +92,15 @@ void writeComplexTypeHeaderFile(FILE* f, HCOMPLEXTYPE obj)
{
if (trGetBuildInFlag(field->type) == 0)
{
- fprintf(f, "#include \"%s.h\"\n", field->type); /* _xsd*/
+
+ fprintf(f, "#include \"%s.h\"\n", trXSDParseNs(field->type)); /* _xsd*/
}
field = field->next;
}
if (obj->base_type != NULL)
{
- fprintf(f, "#include \"%s.h\"\n", obj->base_type);/* _xsd*/
+ fprintf(f, "#include \"%s.h\"\n", trXSDParseNs(obj->base_type));/* _xsd*/
}
/* include libxml library */
@@ -892,7 +894,7 @@ static void writeCodeSaxSerialize(FILE* f, HCOMPLEXTYPE obj)
{
fprintf(f, "\tif (%s_cur->value)\n", field->name);
sprintf(buffer, "%s_Sax_Serialize(%s_cur->value, \"%s\", OnStartElement, OnCharacters, OnEndElement, userData);\n",
- field->type, field->name, field->name);
+ trXSDParseNs(field->type), field->name, field->name);
fprintf(f, "\t\t%s\n", buffer);
}
@@ -929,7 +931,7 @@ static void writeCodeSaxSerialize(FILE* f, HCOMPLEXTYPE obj)
{
fprintf(f, "\tif (obj->%s)\n", field->name);
sprintf(buffer, "%s_Sax_Serialize(obj->%s, \"%s\", OnStartElement, OnCharacters, OnEndElement, userData);",
- field->type, field->name, field->name);
+ trXSDParseNs(field->type), field->name, field->name);
fprintf(f, "\t%s\n", buffer );
}
}
@@ -1042,7 +1044,7 @@ static void writeCodeBaseOnEndElement(FILE* f, HCOMPLEXTYPE obj)
{
fprintf(f, "\tif (%s_cur->value)\n", field->name);
sprintf(buffer, "%s_Sax_Serialize(%s_cur->value, \"%s\", bsce->OnStartElement, bsce->OnCharacters, bsce->OnEndElement, bsce->userData);\n",
- field->type, field->name, field->name);
+ trXSDParseNs(field->type), field->name, field->name);
fprintf(f, "\t\t%s\n", buffer);
}
@@ -1079,7 +1081,7 @@ static void writeCodeBaseOnEndElement(FILE* f, HCOMPLEXTYPE obj)
{
fprintf(f, "\tif (obj->%s)\n", field->name);
sprintf(buffer, "%s_Sax_Serialize(obj->%s, \"%s\", bsce->OnStartElement, bsce->OnCharacters, bsce->OnEndElement, bsce->userData);",
- field->type, field->name, field->name);
+ trXSDParseNs(field->type), field->name, field->name);
fprintf(f, "\t%s\n", buffer );
}
}
@@ -1217,9 +1219,9 @@ static void writeCodeDeserialize(FILE* f, HCOMPLEXTYPE obj)
else
{
if (field->maxOccurs > 1 || field->maxOccurs == -1) {
- fprintf(f, "\t\t\t%s_Add_%s( obj, %s_Deserialize(cur) );\n", field->parentObj->type, field->name, field->type);
+ fprintf(f, "\t\t\t%s_Add_%s( obj, %s_Deserialize(cur) );\n", field->parentObj->type, field->name, trXSDParseNs(field->type));
} else {
- fprintf(f, "\t\t\t%s_Set_%s( obj, %s_Deserialize(cur) );\n", field->parentObj->type, field->name, field->type);
+ fprintf(f, "\t\t\t%s_Set_%s( obj, %s_Deserialize(cur) );\n", field->parentObj->type, field->name, trXSDParseNs(field->type));
}
}