XML Attribute

XML Attributes are used to describe XML elements or to provide additional information about element.
  • XML Attributes provide additional information that is not part of the data



  • XML elements can have attributes in name/value pairs as in HTML.
  • Attributes must always be in quotes. Either single or double quotes are valid, though double quotes are most common.
  • Attributes are always contained within the start tag of an element.
  • XML Attributes & Elements

     AttributesElements
    multiple valuesCan Not contain multiple value Can contain multiple values
    expansibleNot expansibleexpansible
    describe structureCan Not describe structureCan describe structure
    manipulate by program codeare more difficult to manipulate by program codeare easier to manipulate by program code
    validate againist a DTDAttribute values are difficult to validate againist a DTD.Element values are easy to validate aganist a DTD.
    Sample

    Top