Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : XML : Education - Tutorials
XML Schema Infoset Model, Part 2
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPrevious
Next Section
5. Content models
  


Attribute group definitions page 6 of 6


The <attributeGroup> element is used to group a set of <attribute>'s together.


<xsd:attributeGroup name="myNewAttributeGroup" />
   <xsd:attribute name="attribute1" use="required" />
   <xsd:attribute name="attribute2" use="optional" />
   <xsd:attribute name="attribute3" use="required" />
</xsd:attributeGroup>
                                

Referencing a global attribute group declaration
If you want to reference the group of attributes, you must add a reference to it using the ref attribute of the <attributeGroup> element. This is done by calling the following method on the XML Schema model: org.eclipse.xsd.XSDAttributeGroupDefinition.setResolvedAttributeGroupDefinition(XSDAttributeGroupDefinition)

The <attributeGroup> element contains attributes, which are described by XML Schema Part 1: Structures of the standard.

The XML Schema model java interface for a <attributeGroup> is org.eclipse.xsd.XSDAttributeGroupDefinition and can be created by calling org.eclipse.xsd.XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition().


Next Section
Main menuSection menuFeedbackPrevious
About IBM | Privacy | Legal | Contact