The primary purpose of XML, however, is to store data in a way that can be easily read by and shared between software applications. Since XML can be read and interpreted by people as well as computer software, it is known as human- and machine-readable. Since then, it has become one of the most widely used formats for sharing structured information among people, computers, and networks. XML, short for "eXtensible Markup Language," was published by the World Wide Web Consortium (W3C) in 1998 to meet the challenges of large-scale electronic publishing. Let's take a closer look at the purpose and history of this language below. This makes the file easier for humans to read, and does not affect how computers process the code. The beginning and end of each element are represented by a starting tag (e.g., "") and a closing tag (e.g., "") respectively.Īlso, you’ll often see XML code formatted such that each level of element is indented, as is true in our example. Each "student" element contains the elements "firstName," "lastName," "scores," etc. In the example above, "studentsList" is the root element. The topmost element is called the "root" element, and contains all other elements, which are called "child" elements. In an XML file, elements are arranged in a hierarchy, which means that elements can contain other elements. XML HierarchyĮach instance of an XML tag is called an element. Tags aren’t supposed to be seen by users, only the software itself. Each tag represents a type of data, like "first name," "last name," or "score," and tells the computer what to do with the plain text data inside of it. While plain text represents the data, tags indicate what the data is. In this example, the XML is storing student names as well as test scores associated with each student. Plain text is the actual data being stored. The plain text is shown in black and the tags are shown in green. As you can see, this file consists of plain text and tags.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |