XML Lauren Pisciotta Zackary Zweber
History Extensive Markup Language was developed in 1996 by an 11 member group with James Clark as the leader Interestingly this group never met face to face, but rather communicated by and teleconferencing The technology is based off SGML from the 80’s The designers simply took the best parts of SGML and merged it with the ease of use of HTML
Functional Paradigm XML is a meta-language - a language for defining languages In general, FP languages excel at language definition and implementation Using OO design for XML tends merely to make our lives more difficult and our programs less clear
Comparable to HTML Makes use of tags, words are between XML uses the tags only to delimit pieces of data, and leaves the interpretation of the data completely to the application that reads it If you see a in XML it doesn’t mean it’s a new paragraph, it could be anything
XML and Java Functions are to FP what objects are to OOP Both are platform independent Both use data structures
Data Structuring XML is a set of rules for designing text formats that let you structure your data XML is NOT a programming language, and you don't have to be a programmer to use it or learn it XML makes it easy for a computer to generate data, read data, and ensure that the data structure is unambiguous XML avoids common pitfalls in language design: it is extensible, platform-independent, and it supports internationalization and localization
XML as text An advantage to storing XML as text allows it to be opened in any text editor rather than just the original program The rules of XML are more strict than HTML. A forgotten “>” in XML would cause errors allowed in HTML The specifications in XML don’t allow applications to “second guess” what the programmer was trying to do
Bigger by design Since XML is a text format and it uses tags to delimit the data, XML files are nearly always larger than comparable binary formats Although binary would save space, with modern technology it isn’t necessary to make files tiny
The XML Family XML 1.0 – defines tags and attributes XLink – adds hyperlinks XPointer – pointing in XML documents(similar to a URL except points parts in the document) CSS – Style sheet language, used in HTML also XSL – Used for advanced style sheets DOM – set of function calls to manipulate XML files XML Schemas 1&2 – define XML-structure format
Modularity XML allows you to define a new document format by combining and reusing other formats XML provides a namespace mechanism to eliminate confusion when combining formats
XML Syntax Case sensitive Everything must have a close New paragraph (illegal in XML) New paragraph (legal) Proper nesting needed Hello World (illegal) White space is not truncated
Other things XML is license free, so you don’t have to pay anybody to use it It is platform independent, so you can create it with a variety of programs Finally, it’s well supported, so when if you run into trouble there are lots of places to turn for help Choosing XML is comparable to choosing SQL for a database
Hello World Hello, World
Real World Examples
QuickStart XML Tutorial ckary.zweber/xml.htm