xmlutil
xmlutil copied to clipboard
XS AttributeGroup
there is a similar thing in the scheme, can I somehow hold it? Suppose I make a special object where these attributes will be, and I will indicate this object in the necessary elements of the schema. And the library will take it and embed it as internal attributes
<xs:element name="spinner" >
<xs:complexType>
<xs:attribute name="size" use="optional" type="number" />
<xs:attribute name="cover" use="optional" type="xs:string" />
<xs:attributeGroup ref="s:styleattrs" /> <!-- support-->
</xs:complexType>
</xs:element>
An attribute group is mainly a shortcut for multiple attributes declared on an element. The closest comparable in Kotlin is an interface. The way schemas work is not quite in line with the way that classes work.
If you want the group as actual object you are effectively asking for the inlining of an attribute only class. At present this is not supported, and supporting it is somewhat complex due to ordering and the way the serialization library itself is designed, so not really a priority.
ok, i'll try to post my solution here as soon as i'm done