Ben Leslie wrote:
> The specific problem is that the following is malformed; the xsd:restriction
> tag is never closed.
>
> <xsd:simpleType name="Domain.test.public.isoweek">
> <xsd:restriction base="DATE">
> </xsd:simpleType>
>
Exact. Per 9.11 (6, b, iv) or 9.15 (8, m, vi), it's a simple element.
The attached patch should fix it.
I'm attaching another small patch to strip some space and be consistent
with other xml tags.
--
Euler Taveira de Oliveira
http://www.timbira.com/
*** src/backend/utils/adt/xml.c.orig 2007-11-09 16:33:56.000000000 -0200
--- src/backend/utils/adt/xml.c 2007-11-09 16:37:30.000000000 -0200
***************
*** 2987,2993 ****
base_typeoid = getBaseTypeAndTypmod(typeoid, &base_typmod);
appendStringInfo(&result,
! " <xsd:restriction base=\"%s\">\n",
map_sql_type_to_xml_name(base_typeoid, base_typmod));
}
}
--- 2987,2993 ----
base_typeoid = getBaseTypeAndTypmod(typeoid, &base_typmod);
appendStringInfo(&result,
! " <xsd:restriction base=\"%s\"/>\n",
map_sql_type_to_xml_name(base_typeoid, base_typmod));
}
}
*** src/backend/utils/adt/xml.c.orig 2007-11-09 16:33:56.000000000 -0200
--- src/backend/utils/adt/xml.c 2007-11-09 17:01:50.000000000 -0200
***************
*** 2595,2605 ****
if (!tableforest)
appendStringInfo(&result,
! " <xsd:element name=\"%s\" type=\"%s\" />\n",
xmltn, tabletypename);
else
appendStringInfo(&result,
! " <xsd:element name=\"%s\" type=\"%s\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\n",
xmltn, tabletypename);
}
--- 2595,2605 ----
if (!tableforest)
appendStringInfo(&result,
! " <xsd:element name=\"%s\" type=\"%s\"/>\n",
xmltn, tabletypename);
else
appendStringInfo(&result,
! " <xsd:element name=\"%s\" type=\"%s\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n",
xmltn, tabletypename);
}
***************
*** 2656,2662 ****
NULL);
appendStringInfo(&result,
! " <xsd:element name=\"%s\" type=\"%s\" />\n",
xmlsn, schematypename);
}
--- 2656,2662 ----
NULL);
appendStringInfo(&result,
! " <xsd:element name=\"%s\" type=\"%s\"/>\n",
xmlsn, schematypename);
}
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate