0

I have a conceptual question, because I'm currently writing a concept concerning Dataexchange using xml & xsds.

When describing xsds, I often find myself wondering whether I am using the correct vocabulary. If I have, for example a definition as follows in my xsd:

<xs:complexType name="choiceOfKnownDateType">
 <xs:choice>
  <xs:element name="yearMonthDay" type="completeDate"/>
  <xs:element name="yearMonth" type="yearMonthOnly"/>
  <xs:element name="year" type="yearOnly"/>
 </xs:choice>
</xs:complexType>

Am I correctly describing that example as: "We have a complex TYPE consisting of the ELEMENTS yearMonthDay, yearMonth and year. These ELEMENTS are of the TYPE completeDate, yearMonthOnly and yearOnly."

I don't care about the correctness or improvements over the example (I just made it up), I just need to know, whether I am using the terms "Element" and "Type" correctly :)

Thanks a lot in advance

Mischa

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Mischa Obrecht
  • 2,737
  • 6
  • 21
  • 31
  • 1
    An a fairly informal level, your terminology is fine. A pedant, however, would tell you that a type does not consist of elements. Rather, a type defines a content model, which in your case is a choice, and the choice contains a number of particles, which in this case are element particles, and each element particle refers to an element declaration, and the element declarations are named yearMonthDay, yearMonth, and year. – Michael Kay Dec 17 '12 at 18:19
  • thanks Michael, that was the 'pedantic' answer I was looking for :) – Mischa Obrecht Dec 19 '12 at 08:38

1 Answers1

0

Because the example is an xs:choice rather than a sequence it would be more correct to say that the type allows "exactly one child element, which may be either yearMonthDay (of the type completeDate), yearMonth (of the type yearMonthOnly) or year (of the type yearOnly)".

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183