users@jaxb.java.net

Re: Imported GML schema

From: Isabelle KERVELLA <Isabelle.Kervella_at_ifremer.fr>
Date: Mon, 14 Feb 2005 12:46:42 +0100

Ryan, Kohsuke,

Thanks for reply.

The document of GML 2.1.2 specifications mentions that all examples
(city.xsd) have been validated using the following suite of parsers:
· Apache Xerces (v2.0 beta 4)
· Altova XML Spy (v4.2)
· Microsoft MSXML (v4.0)
And the schema feature.xsd and geometry.xsd are parsed by XAmple (using
Xerces).


For you, these schemas contain errors ?
Do you know if the GML 3.0 schemas could pose less problem ?


Else, when I try the "-nv" arg to my build.xml, the error is as follows:

[xjc] [ERROR] A class/interface with the same name
"org.example.GeometryProperty" is already in use. Use a class
customization to resolve this conflict.
[xjc] line 22 of feature.xsd
[xjc] [ERROR] (Relevant to above error) another "GeometryProperty" is
generated from here.
[xjc] line 23 of feature.xsd
[xjc] [ERROR] the property "Feature" is empty and contains no value
[xjc] line 130 of feature.xsd
[xjc] failure in the XJC task. Use the Ant -verbose switch for more details

BUILD FAILED

The solution is perhaps to use an external binding file ? What do you say ?

Isabelle



Ryan Shoemaker - JavaSoft East a écrit:
> Isabelle KERVELLA wrote:
>
>> Greetings,
>>
>> I use WSDP v1.5 (comprising JAXB Version 1.0.4 ) and try to compile an
>> application schema that is importing the GML 2.1.2 schema.
>>
>> It contains the schema attributes and elements :
>>
>> -------------------------------------------------------------------
>> xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> targetNamespace="http://www.opengis.net/examples"
>> xmlns="http://www.opengis.net/examples"
>> xmlns:gml="http://www.opengis.net/gml"
>> gml:version="2.1.2"
>> xmlns:xlink="http://www.w3.org/1999/xlink"
>> xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>> jxb:version="1.0">
>> <xsd:annotation><xsd:appinfo>
>> <jxb:globalBindings generateIsSetMethod="true"/>
>> </xsd:appinfo></xsd:annotation>
>>
>> <!-- import constructs from the GML Feature and Geometry schemas -->
>> <xsd:import namespace="http://www.opengis.net/gml"
>> schemaLocation="feature.xsd"/>
>> -------------------------------------------------------------------
>>
>>
>> feature.xsd uses another schema (geometry.xsd) that is placed,
>> locally, in the same repertory with feature.xsd and the application
>> schema.
>> [feature.xsd and geometry.xsd are available for consultation :
>> http://schemas.opengis.net/gml/2.1.2/]
>>
>>
>> The xjc compiling fails with :
>>
>> -------------------------------------------------------------------
>> [xjc] Compiling
>> file:/C:/JAXB/jaxb/samples/casino/casino_test_2/city.xsd
>> [xjc] [ERROR] rcase-RecurseLax.2: There is not a complete
>> functional mapping between the particles.
>> [xjc] line 297 of geometry.xsd
>>
>> [xjc] [ERROR] derivation-ok-restriction.5.4.2: Error for type
>> 'MultiPolygonType'. The particle of the type is not a valid
>> restriction of the particle of the base.
>> [xjc] line 297 of geometry.xsd
>>
>> [xjc] [ERROR] rcase-RecurseLax.2: There is not a complete
>> functional mapping between the particles.
>> [xjc] line 280 of geometry.xsd
>>
>> [xjc] [ERROR] derivation-ok-restriction.5.4.2: Error for type
>> 'MultiLineSt
>> ringType'. The particle of the type is not a valid restriction of the
>> particle
>> of the base.
>> [xjc] line 280 of geometry.xsd
>>
>> [xjc] [ERROR] rcase-RecurseLax.2: There is not a complete
>> functional mapping between the particles.
>> [xjc] line 263 of geometry.xsd
>>
>> [xjc] [ERROR] derivation-ok-restriction.5.4.2: Error for type
>> 'MultiPointType'. The particle of the type is not a valid restriction
>> of the particle of the base.
>> [xjc] line 263 of geometry.xsd
>>
>> [xjc] failure in the XJC task. Use the Ant -verbose switch for
>> more details
>>
>> BUILD FAILED
>> -------------------------------------------------------------------
>>
>
> XJC performs schema validation during compilation by default - these
> are errors that are being detected in the schema. You can google the
> specific error codes to learn what they mean. You can also try disabling
> schema validation by adding the "-nv" arg to your build.xml:
>
> <xjc schema="city.xsd" package="org.example" target="gen-src"
> extension="true">
> <arg value="-nv" />
> <produces dir="gen-src/org.example" includes="**/*.java" />
> </xjc>
>
> I also changed the task to use the 'extension' attribute rather than
> passing it in as an arg.
>
> --Ryan
>
>>
>> My build.xml file is construct from JAXB sample ?element-substitution?.
>> An extract of this file :
>>
>> -------------------------------------------------------------------
>> <xjc schema="city.xsd" package="org.example" target="gen-src">
>> <arg value="-extension" />
>> <produces dir="gen-src/org.example" includes="**/*.java" />
>> </xjc>
>> -------------------------------------------------------------------
>>
>> Where have I gone wrong ? Do you have an idea ?
>>
>> Thanks.
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>