Multiple choice technology programming languages

The syntax for defining an attribute is

  1. <xs:attribute name="xxx" />

  2. <xs:attribute name="xxx" type="yyy"/>

  3. <attribute name="xxx" type="yyy"/>

  4. <xs:attribute name=xxx type=yyy/>

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In XML Schema Definition (XSD), attributes are defined using the element with both name and type attributes. The type attribute specifies the data type of the attribute value. Option B is correct with proper namespace prefix (xs:) and quoted attribute values.