[Simple-support] Composite attributes
Brought to you by:
niallg
|
From: Sebastian H. <us...@la...> - 2016-02-16 13:26:44
|
Hi,
I have a mapping question for a given XSD. Given a attributeGroup bar, used in many definitions.
<xs:complexType name=„myElement">
<xs:complexContent>
<xs:extension base="ns1:someMoreAttributes">
<xs:attributeGroup ref="ns1:foo" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name=„foo">
<xs:attribute name="name" type="xs:string" />
<xs:attributeGroup ref="ns1:bar" />
</xs:attributeGroup>
<xs:attributeGroup name="bar">
<xs:attribute name=„field1" type="xs:string“/>
<xs:attribute name=„field2" type="xs:string“/>
</xs:attributeGroup>
xml:
<myElement id="abc“ name="aName“ field1="abc“ field2="def“/>
I would like to have a class
class MyElement
String id;
String name;
Bar bar;
}
class Bar{
String field1;
String field2;
}
Is there a way to write attributes to a nested class Bar instead of MyElement?
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
http://www.laliluna.de <http://www.laliluna.de/>
Software developer and Coach for Java, JEE, Clojure and Java Persistence
|