Schemas/GML

From Code Synthesis Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:12, 18 April 2009
Boris (Talk | contribs)
(Add a link to a relevant mailing list thread)
← Previous diff
Revision as of 13:15, 3 February 2010
Boris (Talk | contribs)
(Add a note on compiling GML schemas with CMake.)
Next diff →
Line 19: Line 19:
For ideas on how to handle very large GML documents using the C++/Tree mapping, see the [http://www.codesynthesis.com/pipermail/xsd-users/2009-April/002299.html CityGML 1.0.0 and C++/Parser interface] thread on the xsd-users mailing list. For ideas on how to handle very large GML documents using the C++/Tree mapping, see the [http://www.codesynthesis.com/pipermail/xsd-users/2009-April/002299.html CityGML 1.0.0 and C++/Parser interface] thread on the xsd-users mailing list.
 +
 +Brad Howes has [http://www.codesynthesis.com/pipermail/xsd-users/2010-February/002668.html posted] a well commented [[Media:GML-3_1_1-CMakeList.txt.gz|CMakeLists.txt]] file that compiles the unmodified GML 3.1.1 schemas and builds a dynamic library from the GML C++ classes using CMake. For general information on XSD and CMake, see the [[Using XSD with CMake]] page.
== See also == == See also ==
* [[Talk:Schemas/GML|Discussion page for GML]] * [[Talk:Schemas/GML|Discussion page for GML]]

Revision as of 13:15, 3 February 2010

For the release of XSD 2.3.0 we've fixed the part of the Xerces-C++ bug 1281 that prevented Xerces-C++ schema validator from accepting the GML 3.1.1 schemas. All precompiled binaries of XSD from version 2.3.0 are shipped with this fix. Note that you don't need to patch the version of Xerces-C++ that you are linking to your applications since the bug only affects the validation of schemas (as opposed to the validation of instances against schemas) which is normally disabled. Note also that this bug has been fixed in Xerces-C++ 2.8.0.

While with this patch XSD is able to parse GML 3.1.1 successfully, it is still unable to generate compilable C++ code in the default, file-per-schema mode due to a pathological circular dependency between smil20.xsd and smil20-language.xsd. There are two ways to resolve this issue.

The first approach requires the use of the file-per-type compilation mode which was introduced in XSD 3.1.0. For more information about the file-per-type mode see this blog post.

The second approach involves splitting smil20.xsd into two files. The resulting schemas are semantically equivalent to the original.

The following two packages contain the official GML 3.1.1 schemas placed into a single directory with the smil20.xsd schema split into smil20.xsd and smil20-base.xsd:

We used the following C++/Tree options to compile GML 3.1.1:

--generate-polymorphic --root-element Array --root-element Bag

For ideas on how to handle very large GML documents using the C++/Tree mapping, see the CityGML 1.0.0 and C++/Parser interface thread on the xsd-users mailing list.

Brad Howes has posted a well commented CMakeLists.txt file that compiles the unmodified GML 3.1.1 schemas and builds a dynamic library from the GML C++ classes using CMake. For general information on XSD and CMake, see the Using XSD with CMake page.


See also

Personal tools