140 likes | 279 Views
XML. What is XML?. "eXtensible Markup Language" New development in web creation Overcomes limitations of HTML small number of tags limited features several versions of the language XML allows you to create your own tags Separates content from presentation. SGML, HTML and XML. SGML
E N D
What is XML? • "eXtensible Markup Language" • New development in web creation • Overcomes limitations of HTML • small number of tags • limited features • several versions of the language • XML allows you to create your own tags • Separates content from presentation
SGML, HTML and XML • SGML • Standard Generalised Markup Language • ISO standard since 1986 • complex but widely used "meta-language" • HTML • created using SGML for web delivery • XML • a simplified version of SGML for users to create their own 'markup language' • not just a new version of HTML, a different concept
Creating XML Processing instruction • <?xml version="1.0"?> • <library> • <book> • <author> • <firstname>Bill</firstname> • <lastname>Bryson</lastname> • </author> • <booktitle>Notes From a Small Island</booktitle> • <publisher>Transworld</publisher> • </book> • </library> Tags - "elements"
More XML Markup • Empty elements <curtainup/> • Attributes <book section="short loan"> • Special characters < ℞ • Comments<!--some text--> • Data sections • <![CDATA[ • *a = &b; • c = (d<=3); • ]]>
Using Style with XML • Cascading Style Sheets (CSS) for simple web presentation • booktitle { • margin-left: 10%; • font-weight: bold; • } • Present in multiple formats - print, audio... • XSL eXtensible Style Language • Transformations of XML • e.g. reorder elements
XSL Transformations XSL commands • <H1> • <xsl:for-each select="library/book" • order-by="author/lastname"> • <xsl:value-of select="author/lastname"/> • </xsl:for-each> • </H1> XML elements HTML template for formatting
Uses of XML • Creating web pages - better structure • Improved indexing and searching • www.goxml.com/ • www.w3.org/XML/ • Simple "database" functionality - organising and manipulating data "fields" within the page • Configuring/manipulating information at client - presenting information in different ways to different users • "E-business" - business to business transactions, passing of tailored information e.g. inventory, ordering etc
Linking Developments • XLink • Multiple destinations for a link • Different presentations of a linked resource • replace existing page with new (as now) • embedded in existing page • display in new window • XPointer • Replaces internal anchor • Jump to any XML element within document
XHTML: HTML in XML • Preparing HTML for use in XML browsers • HTML defined in XML • Must close all tags <p> </p> or <p/> • Tags in lower case • Quote attribute values src="logo.gif" • validate/correct documents www.w3.org/People/Raggett/tidy
Browser Compatibility • Support for XML and CSS in common browsers: • Netscape 4 - no XML, moderate CSS • IE4 - partial XML, reasonable CSS • IE5 - good XML and CSS • XML viewers available (special browers or plug-ins) • Server can change XML to HTML before delivery
XML Applications • XML is well established in some areas e.g. MathML (Mathematics Markup Language) • <expr> • <mci>x</mci> • <power/> • <mcn>2</mcn> • </expr> • <plus/> • <mcn>4</mcn> x2+4
XML Applications • MathML (Mathematics Markup Language) www.w3.org/TR/REC-MathML • CML (Chemical Markup Language) www.venus.co.uk/omf/cml/ • RDF (Resource Description Framework) • www.w3.org/RDF/ • SMIL (Synchronised Multimedia Integration Language) www.w3.org/TR/1998/PR-smil-19980409/ • MusicML • www.tcf.nl/trends/trends6-en.html • CFML (Cold Fusion, for database integration) • www.allaire.com/documents/cf45docs/acrobatdocs/45refcard.pdf
References • W3Cs XML HomePage • www.w3.org/XML/ • XML Homepage • www.xml.com • XML FAQ • www.ucc.ie/xml • Ariadne web articles • www.ariadne.ac.uk/issue16/what-is/