[CITE-Forum] A question about XML validator with substitution groups.

Henning Bredel h.bredel at 52north.org
Fri Nov 30 05:19:38 EST 2012


Hey Rocky,

the problem is that XMLBeans can only validate on those schemas which 
were available during compile time (when xsds were compiled to the java 
xml binding jars).

SamplingPoint for example was most probably not available at compile 
time when GML was compiled (and if it was, there could be any other type 
which might be a substitution group of AbstractFeature).

I suggest to extract the exact type and qualify it be parsing it into 
the XYZDocument which can be used then for validation. Then validate the 
whole document without the Substituted type.

I hope this gives you a hint how to do it.

Note: Of course you have to check which validation error occurs so that 
you are able to apply the validation strategy described above!

Best

   Henning

Am 30.11.2012 02:13, schrieb 宗岩 Rocky:
> Hi, all,
>
>          Carsten got an issue when testing SOS 2.0, and It’s seems he is
> right.
>
>          Carsten’s report:
>
> The XMLValidatingParser throws the following message:
>
> Validation error:
 cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'sams:SF_SpatialSamplingFeature'. One of
> '{"http://www.opengis.net/gml/3.2":AbstractFeature}' is expected.
1
> validation error detected.
>
>          This looks like a problem of the used XML validator with
> substitution groups.
>
> Because 'sams:SF_SpatialSamplingFeature' is a substitution of
> gml:AbstractFeature and thus a valid element.
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> In SOS 2.0 9.1.1.2, Table 28:
>
> featureMember's Data type and values => GFI_Feature)
>
> In 10-004r3, Top20 Observations and Measurements, C.1 Introduction:
>
> GFI_Feature is an instance of GF_FeatureType. (ISO19109:2005)
>
> GFI_Feature is implemented in GML (ISO 19136:2007) by
> gml:AbstractFeature element and gml:AbstractFeatureType type
>
> In http://schemas.opengis.net/gml/3.2.1/feature.xsd:
>
> AbstractFeature's substitutionGroup is gml:AbstractGML
>
> In O&M 2.0 XML, 7.15 Spatial sampling feature data,
>
> sams:SF_SaptialSamplingFeature => (implemented)
>
> (represented through sams:SF_SaptialSamplingFeature)
>
>    (dependency - AbstractGeometry (GML 3.2.1 Clause 10.1.3))
>
> In http://schemas.opengis.net/gml/3.2.1/geometryBasic0d1d.xsd:
>
> AbstractGeometry's substitutionGroup is gml:AbstractGML
>
> /----------------------------------------------------------------------------------------------------------------------------------/
>
> /李宗岩//(Rocky)/
>
> /助理工程師//assistant software engineer
> //逢甲大學地理資訊系統研究中心//GIS Research Center, Feng-Chia University/
>
> /04-24516669 #350/
>
> 描述: joinFB <http://www.facebook.com/GIS.FCU>//
>
> -----*/Disclaimer/*-----
>
> /本郵件含有逢甲大學地理資訊系統研究中心機密資訊、或受法律保護之資料,唯
> 有原發信人指定之收信人得閱讀或使用本郵件之內容。如您並非被指定之收信人,
> 請立即將本郵件及所有附件予以刪除;請勿揭露、儲存或使用本郵件之任何資訊,
> 並請您立即告知原發信人rocky at gis.tw本郵件的傳遞錯誤。謝謝您的合作。/
>
> /This e-mail transmission and any attachments contain information from
> Geographic Information Systems Research Center of Feng Chia University.
> The information is confidential and/or privileged and intended to be
> solely for the use of the individuals or entity named in this e-mail
> transmission. If you are not the intended recipient, be aware that any
> disclosure, saving or use of the contents of this e-mail transmission
> and attachments is strictly prohibited. If you have received this email
> transmission in error, please notify us immediately, and delete the
> e-mail and attachments. We greatly appreciate your cooperation.///
>
> */GIS RESEARCH CENTER, FCU/*http://www.gis.tw .*/Tel: 886-4-24516669/*
>
>
>
> _______________________________________________
> CITE-Forum mailing list
> CITE-Forum at lists.opengeospatial.org
> https://lists.opengeospatial.org/mailman/listinfo/cite-forum
>


-- 
Henning Bredel
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster
Fon: +49-(0)-251–396371-34
Fax: +49-(0)-251–396371-11
email: h.bredel at 52North.org
52North-site: http://www.52north.org
General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849


More information about the CITE-Forum mailing list