How you define attributes in XML?

How you define attributes in XML?

We define attribute in XML as same as HTML.But keep one thing in mind In XML every attribute should have a value,We can\'t make attribute without value in XML.Where as in case of HTML we can create attribute without value.


<student active=\"true\">




 In above example \'student\' is a element,\'active\' is a attribute and \'true\' is a attribute value.

<student active>




 This is wrong in case of XML because in this we declare attribute \'active\' without any value.But it will run in case of HTML. 

Date:2014-01-09 00:00:00

Post Your Answers

User Email:

User Name:

Related XML Subjective Links

XML Subjective interview questions and answers for experienced and fresher