Patrick,

can you please confirm that all namespaces are declared. What validation 
tool are you using? Are you testing against a live GeoServer?

My web browser hides xmlns: declarations, and I have to view page source 
to see the full response from GeoServer. If I add namespaces and 
schemaLocations to your response and schema saved to a file, I can get 
them to validate in Eclipse (which uses Xerces).

It is possible that this is a GeoTools bug. That method has several 
branches that are not covered by unit tests (says cobertura). It is also 
possible that the type definition is incomplete because of problems 
resolving schemas.

I can guess that this validation is done in GeoTools either because it 
is very old and predates reliable Xerces, or because it is very fast, or 
because it supports programmatically generated EMF types.

Kind regards,
Ben.


On 02/10/15 18:21, Patrick Valsecchi wrote:
> Hi,
>
> I've first sent that to the Udig ML, but then... it looks more like a
> geotools problem. Can you guy help me on that?
> The geotools version in use by my Udig version is 11.2.
>
> By the way, why the XSD validation done in geotools code and not in
> standard java code?
>
> Thanks.
>
> ---------- Forwarded message ----------
> From: Patrick Valsecchi <patrick.valsec...@camptocamp.com>
> Date: Thu, Oct 1, 2015 at 5:01 PM
> Subject: WFS validation errors
> To: udig-us...@locationtech.org
>
>
> Hi,
>
> I'm trying to access a WFS layer served by geoserver. Nothing fancy or
> special. I get this error most of the time (only if I have features where
> POPULATION is not null):
> SEVERE: Too many elements for http://sbb.ch/sbb:orte (type = orteType) : 2
> children, 1 maxOccurs
> org.geotools.xml.handlers.ComplexElementHandler.validateElementOrder(ComplexElementHandler.java:251)
>
> Looks like the validation is not happy about the response from the server.
> I've used wireshark to see what's happening. Basically, udig gets three
> pages from geoserver:
> The content:
> <wfs:FeatureCollection xsi:schemaLocation="http://sbb.ch/sbb
> http://XXX/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=sbb%3Aorte
> http://www.opengis.net/wfs
> http://XXX/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd";>
>    <gml:boundedBy>
>      <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#21781";>
>        <gml:coordinates decimal="." cs="," ts=" ">612179.4351,118802.2868
> 612179.4351,118802.2868</gml:coordinates>
>      </gml:Box>
>    </gml:boundedBy>
>    <gml:featureMember>
>      <sbb:orte fid="orte.240043267">
>        <gml:boundedBy>
>          <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#21781";>
>            <gml:coordinates decimal="." cs="," ts="
> ">612179.4351,118802.2868 612179.4351,118802.2868</gml:coordinates>
>          </gml:Box>
>        </gml:boundedBy>
>        <sbb:NAME>Saint-Luc</sbb:NAME>
>        <sbb:TYPE>village</sbb:TYPE>
>        <sbb:POPULATION>319</sbb:POPULATION>
>        <sbb:GEOM>
>          <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#21781";>
>            <gml:coordinates decimal="." cs="," ts="
> ">612179.4351,118802.2868</gml:coordinates>
>          </gml:Point>
>        </sbb:GEOM>
>      </sbb:orte>
>    </gml:featureMember>
> </wfs:FeatureCollection>
>
> Then it gets the schema for the sbb namespace:
> <xsd:schema elementFormDefault="qualified" targetNamespace="
> http://sbb.ch/sbb";>
>    <xsd:import namespace="http://www.opengis.net/gml"; schemaLocation="
> http://XXX/geoserver/schemas/gml/2.1.2/feature.xsd"/>
>    <xsd:complexType name="orteType">
>      <xsd:complexContent>
>        <xsd:extension base="gml:AbstractFeatureType">
>          <xsd:sequence>
>            <xsd:element maxOccurs="1" minOccurs="0" name="NAME"
> nillable="true" type="xsd:string"/>
>            <xsd:element maxOccurs="1" minOccurs="0" name="TYPE"
> nillable="true" type="xsd:string"/>
>            <xsd:element maxOccurs="1" minOccurs="0" name="POPULATION"
> nillable="true" type="xsd:decimal"/>
>            <xsd:element maxOccurs="1" minOccurs="0" name="GEOM"
> nillable="true" type="gml:GeometryPropertyType"/>
>          </xsd:sequence>
>        </xsd:extension>
>      </xsd:complexContent>
>    </xsd:complexType>
>    <xsd:element name="orte" substitutionGroup="gml:_Feature"
> type="sbb:orteType"/>
> </xsd:schema>
>
> The third one is the standard gml v2.1.2 schema.
>
> Checking manually my WFS response with the schema, I don't see any problem.
> Did I miss something? What can I do from there?
>
> Thanks.
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

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

------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to