Stefano,

great investigation! The most suspicious difference I can see is the 
Great XLink Migration of 2012, in which OGC switched from their own copy 
of XLinks to W3C XLink without changing schemaLocation version numbers 
or XML namespaces. (Different information model, but instance documents 
should be compatible.) I do not understand why this might affect the 
encoding of a geometry property type. Perhaps debugging the two versions 
in parallel might help?

The gml.xsd include difference (which IIRC I requested via Simon Cox) 
makes individual schema documents valid when loaded in isolation. This 
should not affect app-schema, which starts by loading a top level 
application schema, which should then import gml.xsd.

While app-schema resolves and parses XML schema documents to build 
types, the GeoTools Encoder uses compiled bindings for all supported GML 
versions and their dependencies, including XLinks. Even if you provide 
the new GML 3.2.1.2 schemas, the compiled bindings, Schema, and 
Configuration class are for the old version of GML 3.2.1 and OGC XLinks.

See gt-xsd-gml3 for the GML, GMLSchema, and GMLConfiguration classes 
(separate ones for GML 3.1 and 3.2), and gt-xsd-core for XLINK, 
XLINKSchema, and XLINKConfiguration.

The xmlcodegen module generates binding skeletons and *Schema classes. I 
rewrote parts of xmlcodegen to support the cyclic type definitions in 
GML 3.2.1 and to remove the need to manually remove parts of the input 
schemas, and used this to regenerate GMLSchema for GML 3.2.1 to have a 
more complete information model. The bulk of the work was done by 
Justin, including much handcrafting.

See:
http://docs.geotools.org/latest/userguide/library/xml/internal/index.html
http://docs.geotools.org/latest/userguide/library/xml/internal/code.html

Kind regards,
Ben.

On 26/06/15 01:15, Stefano Costa wrote:
> I forgot to mention that to have a working setup I had to copy in the
> app-schema cache also the xlinks.xsd schema from OGC, which is no longer
> available online at: http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd
>
>
> Il giorno gio, 25/06/2015 alle 14.57 +0200, Stefano Costa ha scritto:
>> Hi Ben,
>> you are of course right: I do have all those jars full of XML schemas on
>> the classpath... but I didn't realize it at first, because Eclipse only
>> added those to the RUNTIME classpath (Run --> Run configurations... -->
>> Classpath) and not to the BUILD classpath (which is what I expected,
>> since the gt-app-schema process does not explicitly export those
>> dependencies). So I kept looking into the .classpath file in the
>> gs-web-app project and couldn't figure out what was going on.
>>
>> Anyway, I did some more experiments and found that if I clear the
>> app-schema cache, extract the GML 3.2.1 schemas from gml-3.2-3.2.1-1.jar
>> and put them in the right place under
>> $GEOSERVER_DATA_DIR/app-schema-cache, the encoding of
>> gml:AbstractGeometry works just fine.
>>
>> So, it looks like there are problems parsing the latest GML 3.2.1
>> schemas available at http://schemas.opengis.net/gml/3.2.1
>> I had a closer look to what's different in the 3.2.1.2 online version
>> (the gml.xsd schema contained in our gml-3.2-* JAR file declares
>> version="3.2.1 2010-01-28"), but it's not much.
>> The latest entry in the README file is dated 2012-07-21 and goes like
>> this:
>>
>>    * v2.0.0 - v3.2.1 WARNING XLink change is NOT BACKWARD COMPATIBLE.
>>    * changed OGC XLink (xlink:simpleLink) to W3C XLink
>> (xlink:simpleAttrs)
>>    per an approved TC and PC motion during the Dec. 2011 Brussels
>> meeting.
>>    see http://www.opengeospatial.org/blog/1597
>>    * implement 11-025: retroactively require/add all leaf documents of an
>>    XML namespace shall explicitly <include/> the all-components schema
>>    * v3.2.1: updated xsd:schema:@version to 3.2.1.2 (06-135r7 s#13.4)
>>
>> I'm attaching the output of a diff between all correspondent schemas.
>>
>> As explained in the README, the only differences are:
>> 1) all schemas (except the root schema gml.xsd) directly now include the
>> root schema via <include schemaLocation="gml.xsd"/>
>> 2) gmlBase.xsd includes http://www.w3.org/1999/xlink.xsd (W3C) instead
>> of http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd (OGC) and
>> references "xlink:simpleAttrs" in place of "xlink:simpleLink"
>> 3) the version attribute of each <schema> element has been upgraded to
>> 3.2.1.2
>>
>> I fail to see how these changes may affect the parsing... does anybody
>> have an idea?
>>
>> Thanks!

-- 
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to