Skip to main content

XML Basics

About

Basics of XML syntax which is widely used in FreeSWITCH™

Click here to expand Table of Contents

Basic XML syntax

XML may look a bit strange if you are not familiar with it. It is very similar to HTML used for web sites. There are many wonderful sites on the web that will provide you a more in-depth tutorial on XML such as...

XML uses tags "<something>" and end tags "</something>". Between these opening and closing tags there are usually more tags specific to the section of the configuration. You will also see single tags that are "self closing" like "<something/>". These tags do something in a single tag and do not need a separate opening and closing tag (like the <action ...> tag).

The easiest way to think of XML is as an outline for a book. In a book outline there are Sections, Chapters, and Pages. Sections contain Chapters that in turn contain pages like this.

  • Book
    • Section 1
      • Chapter 1
        • Page 1-1-1
          • Page 1-1-2
        • Chapter 2
          • Page 1-2-1
            • Page 1-2-2
    • Section 2
      • Chapter 1
        • Page 2-1-1
          • Page 2-1-2
        • Chapter 2
          • Page 2-2-1
            • Page 2-2-2

Tags that start with "<!--" and end with "-->" are comments and are there to either add further textual explanation or to disable a tag (or tags) without removing them from the file.

Note: To assist us humans visually it is generally recommended that each subordinate tag be indented as you would do with a bulleted list but this is not necessary for the parser to understand the hierarchy and process it.

See Also