Schemas/GML

From Code Synthesis Wiki

< Schemas(Difference between revisions)
Jump to: navigation, search
Revision as of 14:16, 2 August 2007
Boris (Talk | contribs)
(Remove deprecated options)
← Previous diff
Current revision
Boris (Talk | contribs)
(GML 3.2.0)
Line 1: Line 1:
 +== GML 3.1.1 ==
 +
For the release of XSD 2.3.0 we've fixed the part of the [https://issues.apache.org/jira/browse/XERCESC-1281 Xerces-C++ bug 1281] that prevented Xerces-C++ For the release of XSD 2.3.0 we've fixed the part of the [https://issues.apache.org/jira/browse/XERCESC-1281 Xerces-C++ bug 1281] that prevented Xerces-C++
schema validator from accepting the [http://schemas.opengis.net/gml/ 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 schema validator from accepting the [http://schemas.opengis.net/gml/ 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.+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 due to a pathological circular dependency between smil20.xsd and smil20-language.xsd. This however is easy to overcome by splitting smil20.xsd into two files. The resulting schemas are semantically equivalent to the original. +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 [http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ 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: 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:
Line 12: Line 18:
We used the following C++/Tree options to compile GML 3.1.1: We used the following C++/Tree options to compile GML 3.1.1:
- --generate-polymorphic --root-element Array --root-element Bag+ --generate-polymorphic
 + --polymorphic-type-all
 + --root-element Array
 + --root-element Bag
 + 
 +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 as well as the <code>streaming</code> example in the XSD distribution.
 + 
 +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.
 + 
 +== GML 3.2.0 ==
 + 
 +The GML 3.2.0 schemas can only be compiled in the file-per-type mode. The following two packages contain sample Makefiles, XSD options files, and README files that show how to compile these schemas using XSD. The first package writes all the generated files into a single directory (that is, it flattens the directory hierarchy) while the second package shows how to place the generated files into separate sub-directories.
 + 
 +* [[Media:Gml-3.2.1.tar.gz|gml-3.2.1.tar.gz]]
 +* [[Media:Gml-3.2.1.zip|gml-3.2.1.zip]]
 + 
 +* [[Media:Gml-3.2.1-split-code.tar.gz|gml-3.2.1-split-code.tar.gz]]
 +* [[Media:Gml-3.2.1-split-code.zip|gml-3.2.1-split-code.zip]]
== See also == == See also ==
* [[Talk:Schemas/GML|Discussion page for GML]] * [[Talk:Schemas/GML|Discussion page for GML]]

Current revision

GML 3.1.1

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
--polymorphic-type-all
--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 as well as the streaming example in the XSD distribution.

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.

GML 3.2.0

The GML 3.2.0 schemas can only be compiled in the file-per-type mode. The following two packages contain sample Makefiles, XSD options files, and README files that show how to compile these schemas using XSD. The first package writes all the generated files into a single directory (that is, it flattens the directory hierarchy) while the second package shows how to place the generated files into separate sub-directories.

See also

Personal tools