FIT2043 Lecture Notes - Lecture 9: Intermediate Representation, Xml, Text Editor
L9 - Intro to XML
What is XML?
● A markup language
○ Advantages
■ Separate information about content from information about
presentation (Semantic Structure)
■ Allows you to produce multiple difference presentation from a single
set of content (Single Sourcing)
● Used as an intermediate language for web development and as a format for
exchanging data between programs
● Used for storing structure information
Editing XML files
● Plaintext; can be written in any text editor
● Prolog: a declaration which a XML document begins with
○ Tells you the version of the XML
○ Tells you the encoding
● Tags
○ The body of an XML document is contained in this
○ Types
■ Opening tag: <name>
■ Closing tag: </name>
■ Empty tag: <name/>
○ Can enclose data
●Element:
made up of a start tag, it’s matching end tag and everything in between
● Attributes
○ Go in opening tags
○ Give more information about the data
○ Value must surrounded by straight quotes
● Case sensitive
● Tags have to be properly nested
● A documents contains
○ A prolog
○ One root elements: can contain other elements
XML Schema Documents
● File extension .xsd
● Can define:
○ Name of the root element
○ Which elements can contain which other elements
find more resources at oneclass.com
find more resources at oneclass.com