[xsd-users] how do i use xse:refType with extra attribute?
Omkar Wagh
owagh at tower-research.com
Thu May 31 15:03:41 EDT 2012
Hi Boris.
On 05/31/2012 02:41 PM, Boris Kolpackov wrote:
> Hi Omkar,
>
> Omkar Wagh<owagh at tower-research.com> writes:
>
>> I have the following schema :-
>>
>> <xs:complexType name="ref_T">
>> <xs:simpleContent>
>> <xs:extension base="xs:IDREF">
>> <xs:attribute name="extra_param" type="xs:integer" />
>> </xs:extension>
>> </xs:simpleContent>
>> </xs:complexType>
>>
>> <xs:complexType name="option_T">
>> <xs:choice>
>> <xs:element name="reference" type="ref_T" xse:refType="some_type_T" />
>> </xs:choice>
>> </xs:complexType>
> No, this won't work. We don't generate a template for ref_T which
> can later be specialized with a referenced type. This, however, will
> work:
>
> <xs:complexType name="ref_to_some_type_T">
> <xs:simpleContent>
> <xs:extension base="xs:IDREF" xse:refType="some_type_T">
> <xs:attribute name="extra_param" type="xs:integer" />
> </xs:extension>
> </xs:simpleContent>
> </xs:complexType>
>
> <xs:complexType name="option_T">
> <xs:choice>
> <xs:element name="reference" type="ref_to_some_type_T"/>
> </xs:choice>
> </xs:complexType>
It looks like this should work but it doesn't. xsd quits with the
following :-
xsd:
/apps/stonefs1/owagh/softwares/xsd-3.3.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.hxx:411:
XSDFrontend::SemanticGraph::Scope&
XSDFrontend::SemanticGraph::Nameable::scope(): Assertion `named_p ()'
failed.
Omkar
>
> Boris
More information about the xsd-users
mailing list