What is the difference between <xs:group> and <xs:attributeGroup>?

69 Views Asked by At

I'd like to understand the difference and use cases of each group type.

I've seen this example in W3 schools, and it wasn't clear when to use either.

1

There are 1 best solutions below

0
kjhughes On

XSD xs:group and xs:attributeGroup enable declaration reuse in xs:complexType definitions:

  • Use xs:group to define a named, reusable group of elements.

  • Use xs:attributeGroup to define a named, reusable group of attributes.

See W3C XML Schema Part 0: Primer for xs:group and xs:attributeGroup examples.

See also