[xsd-users] how do i use xse:refType with extra attribute?
Boris Kolpackov
boris at codesynthesis.com
Thu May 31 14:41:25 EDT 2012
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>
Boris
More information about the xsd-users
mailing list