Test on XML Schema Definition (XSD) Guide
XML Schema Definition (XSD) Guide for Students
Test: XML Schema (XSD)
20 questions
Question 1: When an XML Schema attribute is defined with a default value, the parser will automatically assign this value if the attribute is omitted in the XML document instance.
A. Ano
B. Ne
Explanation: If an attribute is defined with a 'default' value, the parser adds the attribute with this value when it is not present in the XML document.
Question 2: The regular expression `ab?c` will only match the string "abc".
A. Ano
B. Ne
Explanation: The regular expression `ab?c` means 'a' followed by zero or one occurrences of 'b', followed by 'c'. Therefore, it will match both "ac" and "abc", not just "abc".
Question 3: The study materials indicate that global declaration of elements involves defining elements solely within a complex type's sequence.
A. Ano
B. Ne
Explanation: The study materials illustrate global declaration of elements with examples like < xs:element name="firstname" type="xs:string"/>, which are defined directly under the <xs:schema> element, not solely within a complex type's sequence. This approach is associated with the 'Salami Slice Design' pattern, where individual components are defined globally and then referenced, as shown on slide 78.
Question 4: Using `xs:whiteSpace value="collapse"` in an XML Schema definition causes multiple spaces to be replaced by a single space.
A. Ano
B. Ne
Explanation: The `xs:whiteSpace value="collapse"` setting replaces line feeds, tabs, spaces, and carriage returns by a single space, including cases where multiple spaces are present.
Question 5: The xs:date data type in XML Schema supports specifying only the year, month, and day, without any options for indicating Coordinated Universal Time (UTC) offsets.
A. Ano
B. Ne
Explanation: The study materials explicitly show examples of the xs:date data type including UTC offsets, such as "<date>2010-11-08Z</date>" and "<date>2010-11-08+02:00</date>", indicating that it does support these specifications.