.. _tinyows_libxmlschemagmlbug:
*****************************************************************************
Working Around the LibXML2 XSD Schema GML Bug
*****************************************************************************
Issue
-----------------------------------------------------------------------------
TinyOWS makes use of GML, an XML-based language that encodes
geometry. Frequently the input and the output of TinyOWS are in GML.
As of February 2012, the current release of Libxml2 does not correctly
handle GML 3.1.1 XSD Schema (see
https://bugzilla.gnome.org/show_bug.cgi?id=630130). The trunk of
Libxml2's repository does handle GML 3.1.1.
Workaround and options
----------------------
For TinyOWS users, you have several options
- Take the latest trunk version from the official Libxml2 git repository:
.. code-block:: bash
git clone git://git.gnome.org/libxml2
- Patch your own copy of LibXML2 release and link TinyOWS against your
local copy:
.. code-block:: bash
--- xmlschemas.c.orig 2011-04-24 14:58:16.000000000 +0000
+++ xmlschemas.c 2011-04-24 15:47:50.000000000 +0000
@@ -15158,7 +15158,11 @@
}
if ( (WXS_IS_LIST(type) || WXS_IS_UNION(type)) &&
(WXS_IS_RESTRICTION(type) == 0) &&
- (! WXS_IS_ANY_SIMPLE_TYPE(baseType))) {
+ (
+ (! WXS_IS_ANY_SIMPLE_TYPE(baseType))
+ && (baseType->type != XML_SCHEMA_TYPE_SIMPLE)
+ )
+ ) {
xmlSchemaPCustomErr(ctxt,
XML_SCHEMAP_ST_PROPS_CORRECT_1,
WXS_BASIC_CAST type, NULL,
}}}
- Modify the XSD GML Schema itself (but you violate the OGC License if you do this!):
.. code-block:: bash
Index: schema/gml/3.1.1/base/valueObjects.xsd
===================================================================
--- schema/gml/3.1.1/base/valueObjects.xsd (revision 550)
+++ schema/gml/3.1.1/base/valueObjects.xsd (revision 561)
@@ -200,11 +200,13 @@
+
-
+
@@ -223,6 +224,7 @@
+-->
+
@@ -230,5 +232,4 @@
-
@@ -241,4 +242,5 @@
+-->
- Or choose to use only GML 2.1.2 in the meantime.