Question 1
Topic: Basic XML and XML Schema Concepts
Skill tested: Designs XML Schema constraints for structurally valid service message elements.
A provider accepts purchase-order XML from several independent clients. The order identifier must appear exactly once, the optional delivery note may appear at most once, and each order must contain one or more line items in the declared order. The provider also needs to reject documents that include undeclared elements, rather than silently accepting arbitrary additions. Which XML Schema design best enforces these structural requirements?
An xs:sequence enforces the declared child order. Elements have a default minOccurs and maxOccurs of 1, so the identifier appears exactly once; the delivery note becomes optional with minOccurs="0"; and line items require at least one occurrence while permitting additional items. A leaves the schema open and does not specify the required line-item cardinality. xs:all does not enforce sequence order, and making every child optional weakens the requirements. Global declarations alone do not define the order or occurrence constraints of the order's content.