Can you file a issue with the test case? You made some changes to the
schema to add a customization, right?
(I'm sorry for the delay in this response)
Peizhao Hu wrote:
> Hi
>
> well, you are right in my example schema, the whole set of schema is
> from upcoming SensorML standard. you can download the whole set from
> http://vast.uah.edu/SensorML/schema/sensorML_2006-05-09.zip
> the problem occurs when mapping the process.xsd under
> sensorML/1.0.30/base. it referred to parameter.xsd SubstitutionGroups as
> described.
> As sensorml is becoming more and more popular, I guess there would be
> more people try to map the schema to Java objects.
>
> many thanks
>
> regards;
>
> Peizhao
>
>
>
> Kohsuke Kawaguchi wrote:
>>
>> Your schema fragment didn't compile because I don't have two types
>> referenced from there, so I modified it as follows, and that compiled
>> just fine.
>>
>> So I think if you still see this problem you should file an issue with
>> a complete schema as an attachment.
>>
>>
>> modified schema:
>>
>> <xs:schema targetNamespace="http://www.opengis.net/swe"
>> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
>> xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>> jaxb:extensionBindingPrefixes="xjc"
>> xmlns:xlink="http://www.w3.org/1999/xlink"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:swe="http://www.opengis.net/swe"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> jaxb:version="2.1" >
>>
>>
>> <!--============================-->
>>
>> <!-- Main Substitution Groups -->
>>
>> <!--============================-->
>>
>> <xs:element name="_DataGroup" type="xs:anyType" abstract="true">
>> <xs:annotation>
>> <xs:appinfo>
>> <xjc:substitutable />
>> </xs:appinfo>
>> </xs:annotation>
>> </xs:element>
>>
>> <xs:element name="_DataArray" type="xs:anyType" abstract="true">
>> <xs:annotation>
>> <xs:appinfo>
>> <xjc:substitutable />
>> </xs:appinfo>
>> </xs:annotation>
>> </xs:element>
>> </xs:schema>
>>
>>
>> Peizhao Hu wrote:
>>> Hi,
>>>
>>> I tried to use JAXB RI 2.1.2 to bind a set of xml schema. however, It
>>> failed when binding "substitutionGroup", I have modified the schema
>>> with customisation annotations as shown below, however, it still
>>> generate errors. I searched on google for this errors, but no luck.
>>> do you have any idea?
>>>
>>>
>>> //====================== Error ===================
>>> SensorML_examples/schemas/sweCommon/1.0.30$ xjc.sh parameters.xsd
>>> -extension
>>> parsing a schema...
>>> [ERROR] compiler was unable to honor this substitutable
>>> customization. It is attached to a wrong place, or its inconsistent
>>> with other bindings.
>>> line 26 of
>>> file:/home/phu/programming/SensorML_examples/schemas/sweCommon/1.0.30/parameters.xsd
>>>
>>>
>>> [ERROR] (the above customization is attached to the following
>>> location in the schema)
>>> line 23 of
>>> file:/home/phu/programming/SensorML_examples/schemas/sweCommon/1.0.30/parameters.xsd
>>>
>>>
>>> [ERROR] compiler was unable to honor this substitutable
>>> customization. It is attached to a wrong place, or its inconsistent
>>> with other bindings.
>>> line 33 of
>>> file:/home/phu/programming/SensorML_examples/schemas/sweCommon/1.0.30/parameters.xsd
>>>
>>>
>>> [ERROR] (the above customization is attached to the following
>>> location in the schema)
>>> line 30 of
>>> file:/home/phu/programming/SensorML_examples/schemas/sweCommon/1.0.30/parameters.xsd
>>>
>>>
>>> Failed to parse a schema.
>>>
>>>
>>>
>>>
>>> //====================== schema ===================
>>> <xs:schema targetNamespace="http://www.opengis.net/swe"
>>> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
>>> xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
>>> jaxb:extensionBindingPrefixes="xjc"
>>> xmlns:xlink="http://www.w3.org/1999/xlink"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>> xmlns:swe="http://www.opengis.net/swe"
>>> elementFormDefault="qualified"
>>> attributeFormDefault="unqualified"
>>> jaxb:version="2.1" >
>>>
>>>
>>> <!--============================-->
>>>
>>> <!-- Main Substitution Groups -->
>>>
>>> <!--============================-->
>>>
>>> <xs:element name="_DataGroup" type="swe:_GroupBaseType"
>>> abstract="true">
>>> <xs:annotation>
>>> <xs:appinfo>
>>> <xjc:substitutable />
>>> </xs:appinfo>
>>> </xs:annotation>
>>> </xs:element>
>>> <xs:element name="_DataArray" type="swe:_ArrayBaseType"
>>> abstract="true">
>>> <xs:annotation>
>>> <xs:appinfo>
>>> <xjc:substitutable />
>>> </xs:appinfo>
>>> </xs:annotation>
>>> </xs:element>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com