XML TutorialLesson 7Free preview
XML Attributes
This lesson is part of XML · All levels
Summary
The XML attribute provides additional information about the element and is written in the opening tag with the name="value" pattern. The attribute must have a value in the form of a quoted text, and the same name must not appear twice on one element. It is best to use attributes for meta data such as id or date, whereas repeating data is best to be child elements.
Key points
- Attributes written on the opener tag in the name="value" format
- The attribute value must be packed with a quote
- Attributes must not be duplicated in one element
- Attributes suitable for metadata such as id, class, or date
- Repeated data is more accurately written as elements than attributes.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.