xmlutil icon indicating copy to clipboard operation
xmlutil copied to clipboard

XS AttributeGroup

Open SchweinchenFuntik opened this issue 2 years ago • 2 comments

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>

SchweinchenFuntik avatar Nov 28 '22 19:11 SchweinchenFuntik

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.

pdvrieze avatar Nov 28 '22 20:11 pdvrieze

ok, i'll try to post my solution here as soon as i'm done

SchweinchenFuntik avatar Nov 28 '22 21:11 SchweinchenFuntik