The XML syntax is a set of rules that defines the combinations of symbols considered to be a correctly structured XML document or fragment. This lesson describes how to write XML syntax.



XML Example:
<?xml version="1.0" encoding="UTF-8" ?>
<address>
  <name>Alex</name>
  <company>w3schools</company>
  <phone>(091) 123-4567</phone>
</address>

In the above example, employee information is stored in XML.

XML Tag

Syntax:

<name>Alex</name>
  • XML tags are surrounded by the two characters < and >.
  • The start tag is often called the opening tag, and the end tag is often called the closing tag.
  • All XML elements must have a closing tag.
  • XML tags must be closed in the proper order.
  • XML Tags are Case Sensitive.
  • The text between the start and end tags is the data.

XML Start Tag

Syntax:

<name>

XML End Tag

Syntax:

</name>

Empty XML Tag

Syntax:

<name></name>


Found This Page Useful? Share It!
Get the Latest Tutorials and Updates
Join us on Telegram