Akash Varshney
What is the difference between Elements and Attributes in XML ?
By Akash Varshney in XML on Oct 04 2015
  • Keerthi Venkatesan
    Aug, 2016 3

    Attributes consist of a named pair attached to an element start-tag. An example of how an attribute is:Image

    • 1
  • Keerthi Venkatesan
    Aug, 2016 3

    Elements can be parents of other elements and/or attributes and can be repeated within the same level of an XML document. They also usually have start and end tags. An element would look like:Image

    • 1
  • Bidyasagar Mishra
    Jul, 2019 12

    we are using Elements as nodes.
    we are using Attributes inside the nodes
    Example:

    1. <student sex="male">Bidyasagar</student>

    In the above example is an element
    and sex=”male” is atribute.

    • 0
  • Keerthi Venkatesan
    Aug, 2016 3

    Elements can be defined to be in a certain order, while attributes can appear in any order

    • 0
  • Keerthi Venkatesan
    Aug, 2016 3

    Elements can occur more than once (repeating) within the same level, while attributes can only appear once within the same level

    • 0
  • Akash Varshney
    Oct, 2015 4

    Elements can contains another element but attributes won't.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS