nerdexam
Microsoft

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"…

Understanding .NET Framework Concepts

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)
  • A
    83% (25)
  • B
    3% (1)
  • C
    10% (3)
  • D
    3% (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

#XML schema#XSD#default value#element definition

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice