What is the purpose of `<xs:annotation>` in XSD?
A
To define a numeric constraint B
To specify attributes for an element C
To add documentation or comments to schema definitions D
To validate XML instances
Analysis & Theory
`<xs:annotation>` is used to add human-readable documentation or comments within a schema.
What does `default` attribute in `<xs:element>` do?
A
Forces a required value B
Sets the minimum value C
Provides a fallback value if the element is missing D
Marks the element as fixed
Analysis & Theory
`default` assigns a value to the element if it's omitted from the instance document.
What is the effect of using the `fixed` attribute in an `<xs:element>`?
A
It restricts the element to a fixed data type B
The element must appear exactly once C
The element must contain exactly the fixed value D
It is equivalent to default
Analysis & Theory
`fixed` enforces that the element's value must exactly match the given fixed value.
What does `nillable="true"` mean in XSD?
A
The element is optional B
The element can have an empty string as value C
The element can explicitly appear with `xsi:nil="true"` D
The element must have a default value
Analysis & Theory
`nillable="true"` means the element can appear with `xsi:nil="true"`, indicating null-like behavior.
Which namespace prefix is used to indicate a null value in XML?
A
xsd:nil B
xsi:nil C
xml:nil D
ns:nil
Analysis & Theory
`xsi:nil` (from the XML Schema Instance namespace) is used to indicate a nil/null value.
Which element is used to import types from another namespace in XSD?
A
<xs:include> B
<xs:import> C
<xs:namespace> D
<xs:reference>
Analysis & Theory
`<xs:import>` allows importing schema definitions from different namespaces.
Which XSD element is used to reuse schema components from the same namespace?
A
<xs:extend> B
<xs:include> C
<xs:reuse> D
<xs:map>
Analysis & Theory
`<xs:include>` includes schema components from the same target namespace.
What is the purpose of the `targetNamespace` attribute in an XSD file?
A
It points to the location of the XML file B
It defines the namespace for the XML instance document C
It sets the default XML version D
It declares the document encoding
Analysis & Theory
`targetNamespace` sets the namespace that the XSD elements and types belong to, ensuring uniqueness.