FIT2043 Lecture Notes - Lecture 9: Intermediate Representation, Xml, Xslt
![](https://new-preview-html.oneclass.com/aAyDl2zeo7d4jWY9k8YAQ83M69wRbkvx/bg1.png)
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
Document Summary
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. Plaintext; can be written in any text editor. Prolog: a declaration which a xml document begins with. Tells you the version of the xml. The body of an xml document is contained in this. Element: made up of a start tag, it"s matching end tag and everything in between. One root elements: can contain other elements. Which elements can contain which other elements. The order in which elements must appear. The type of the data that each element can contain. Can use an xml validating tool to check that a particular xml file mates a given schema. You tell the computer what you want to do , and the computer what to achieve.