98-372 · Question #120
How will you define a default value, Yellow, for a simple element of the XML schema?
The correct answer is A. <xs:element name="ColorName" type="xs:string" default="Yellow"/>. In XML schema, a default value is automatically assigned to the element when no other value is specified. The following is the syntax for the default value for a simple element: <xs:element name="element_name" type="data_type" default="value"/> <xs:element name="ColorName"…
Question
How will you define a default value, Yellow, for a simple element of the XML schema?
Options
- A<xs:element name="ColorName" type="xs:string" default="Yellow"/>
- B<xs:element name='ColorName' default='Yellow'/>
- C<xs:element ID='ColorName' default='Yellow'/>
- D<xs:element ID="ColorName" name="Color" type="xs:string" default="Yellow"/>
How the community answered
(30 responses)- A83% (25)
- B3% (1)
- C10% (3)
- D3% (1)
Explanation
In XML schema, a default value is automatically assigned to the element when no other value is specified. The following is the syntax for the default value for a simple element: <xs:element name="element_name" type="data_type" default="value"/> <xs:element name="ColorName" type="xs:string" default="Yellow"/> Here, the default value is "Yellow". Answer: D, B, and C are incorrect. The values should be in double quote (") instead of a single
Topics
Community Discussion
No community discussion yet for this question.