Humanities Home page   Office of Digital Humanities
Back     BYU LiveCode Lessons Gateway

Introduction to XML

What is XML? (From w3schools.com)

XML stands for EXtensible Markup Language.

XML was designed to describe data.

XML is a software- and hardware-independent tool for carrying information.

See this concise description: http://www.w3schools.com/xml/xml_whatis.asp (first two pages)

HTML is similar in format to XML, but is designed for a different purpose.

HTML is about displaying information, while XML is about carrying information.

Key concept: "[An] XML document does not DO anything. It is just information wrapped in tags. Someone must write a piece of software to send, receive or display it."

Sample XML:

<?xml version="1.0"?>
<employeeTable>
	<employee IDnum="1">
		<firstName>Steve</firstName>
		<lastName>Jobs</lastName>
		<roomNum>001</roomNum>
		<phoneExt>345</phoneExt>
		<parkingSlot>100</parkingSlot>
	</employee>
	<employee IDnum="2">
		<firstName>Bill</firstName>
		<lastName>Gates</lastName>
		<roomNum>284</roomNum>
		<phoneExt>666</phoneExt>
		<parkingSlot>987</parkingSlot>
	</employee>
	<employee IDnum="3">
		<firstName>Linus</firstName>
		<lastName>Torvald</lastName>
		<roomNum>43</roomNum>
		<phoneExt>479</phoneExt>
		<parkingSlot>123</parkingSlot>
	</employee>
	<employee IDnum="4">
		<firstName>Kevin</firstName>
		<lastName>Miller</lastName>
		<roomNum>100</roomNum>
		<phoneExt>421</phoneExt>
		<parkingSlot>987</parkingSlot>
	</employee>
</employeeTable>

LiveCode has tools for working with XML built into the language. See references for "revXML..." in the LiveCode Dictionary. However, these XML tools can be a little complicated to work with. The good news is that there are a few third-party XML scripts that will convert an XML text to an array and vice-versa. One good example can be found at https://gist.github.com/trevordevore/5584753.


Back     BYU LiveCode Lessons Gateway
Maintained by Devin Asay.
Copyright © 2005 Brigham Young University.
This page last updated on March 08, 2016 10:51:14.