1. Home
  2. Docs
  3. Web Technology I
  4. eXtensible Markup Languag...
  5. Elements and Attributes

Elements and Attributes

Here is the explanation of Elements and Attributes:

<book>
    <title>Introduction to XML</title>
    <author>John Doe</author>
</book>
<book category="programming" language="en">
    <title>XML Fundamentals</title>
    <author>Jane Smith</author>
</book>
<library location="Main Street">
    <book category="fiction">
        <title>The Great Gatsby</title>
        <author>F. Scott Fitzgerald</author>
    </book>
    <book category="science">
        <title>A Brief History of Time</title>
        <author>Stephen Hawking</author>
    </book>
</library>
  • The <library> element contains an attribute (location) providing additional information about the library.
  • Each <book> element has a category attribute, providing details about the type of book.
  • <title> and <author> are elements within the <book> elements, encapsulating the book’s title and author information.

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *