What does 'elements-only' mean in an XSD complex type?
A
The element can only contain attributes B
The element must contain only child elements, not text C
The element must contain only text and no child elements D
The element can be empty
Analysis & Theory
In the elements-only content model, the element must contain only nested elements and not character data.
Which XSD construct is used to define 'elements-only' content?
A
<xs:all> B
<xs:choice> C
<xs:sequence> D
All of the above
Analysis & Theory
All of `<xs:sequence>`, `<xs:choice>`, and `<xs:all>` define elements-only content models depending on structure rules.
Which of the following defines an element 'person' with elements-only content ('name' and 'age')?
A
<xs:element name="person"><xs:complexType><xs:sequence><xs:element name="name" type="xs:string"/><xs:element name="age" type="xs:int"/></xs:sequence></xs:complexType></xs:element> B
<xs:element name="person"><xs:simpleType><xs:string/></xs:simpleType></xs:element> C
<xs:element name="person" type="xs:string"/> D
<xs:element name="person"><xs:complexType/></xs:element>
Analysis & Theory
This structure defines a complex element that contains only other elements in a sequence — typical of elements-only content.
In elements-only content, what is not allowed inside the XML element?
A
Child elements B
Attributes C
Text content between elements D
Empty child elements
Analysis & Theory
Text content (character data) is not allowed in elements-only content models.
Which attribute must be added to the `<xs:complexType>` to define elements-only content explicitly?
A
content="elements-only" B
mixed="false" C
type="elements" D
structure="element"
Analysis & Theory
The `mixed="false"` attribute ensures the complex type only contains child elements and no text.
What will happen if an element with elements-only content contains plain text?
A
The text will be ignored B
It will be converted to an attribute C
It will cause a validation error D
It will be treated as a comment
Analysis & Theory
Text is not allowed in elements-only content. Any text between child elements will cause a validation error.
Can an elements-only element in XSD also have attributes?
A
No, attributes are only allowed in text-only elements B
Yes, attributes can be defined alongside elements-only content C
Yes, but only one attribute D
Only if the type is simpleType
Analysis & Theory
Even in elements-only content models, attributes can be added using `<xs:attribute>`.