Introducing XML : Table of Contents 1. From HTML to XML 2. Well-Formed XML 3. Validity / DTDs 4. Encodings 5. XML Namespaces 6. XML Schema 7. XML Tools 8. XML APIs / SAX 9. XML APIs / DOM 10. Stylesheets : CSS & XSL 11. XML Query Language (XQL)
1. From HTML to XML Drei Sonaten und drei Partiten für Violine solo Drei Sonaten und drei Partiten für Violine solo Publisher : Bärenreiter Composer : J. S. Bach … Drei Sonaten und drei Partiten für Violine solo Bärenreiter J. S. Bach...
2. Well-Formed XML An XML document is called well-formed if 1. It starts with the XML prolog, i.e The tags are properly nested, 3. There is exactly one root element,... The XML spec :
3. Validity / DTDs An XML document is valid, if it has an associated document type declaration and if the document complies with the constraints expressed in it. <!ELEMENT music (title, publisher, composer?, opus?, remarks?, instruments?, pieces)> <!ATTLIST music ismn CDATA #IMPLIED... A Gentle Introduction to SGML :
4. Encodings Drei Sonaten und drei Partiten für Violine solo Bärenreiter … ISO , western european, one byte per character, superset of US-ASCII UTF-8, at least one byte per character, superset of US-ASCII UTF-16, two bytes per character, endian problem UTF-32, four bytes per character, endian problem Unicode Consortium Homepage:
5. XML Namespaces XML namespaces provide a simple method for qualifying element and attribute names used in XML documents by associating them with namespaces identified by URI references. …... W3C Rec., Namespaces in XML :
6. XML Schema …... XML Schema Part 1: Structures : XML Schema Part 2: Datatypes :
7. XML Tools XML Parsers expat, James Clark, C, XP, James Clark, Java, IE5 XJParser, DataChannel, XML Editors Notepad XMetaL, SoftQuad, Adept, Arbortext, ADEPT_Series/adept_series.html
8. XML APIs / SAX SAX 1.0: a free API for event-based XML parsing import org.xml.sax.Parser; import org.xml.sax.DocumentHandler; import org.xml.sax.helpers.ParserFactory; Parser parser = ParserFactory.makeParser("com.microstar.xml.SAXDriver"); DocumentHandler handler = new MyHandler(); parser.setDocumentHandler(handler); parser.parse(" import org.xml.sax.HandlerBase; import org.xml.sax.AttributeList; public class MyHandler extends HandlerBase { public void startElement (String name, AttributeList atts) {... SAX Homepage :
9. XML APIs / DOM A platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of XML and HTML documents. import org.w3c.dom.*; import com.docuverse.dom.*; DOM dom = new com.docuverse.dom.DOM();... doc = dom.openDocument(url); BasicElement rootNode = (BasicElement) doc.getDocumentElement(); NodeList list = rootNode.getChildNodes(); Integer.toString(list.getLength()) + " Children");... DOM Level 1 Specification :
10. Stylesheets … XSL spec : The W3C’s CSS Homepage : DSSSL Page at Mulberry Technologies :
11. XML Query Language (XQL) The XML Query Language (XQL) is a query language for XML using the structure of XML as its data model. Sonata I BWV 1001 Adagio Fuga Allegro... //piece//movement[title=“Adagio”] A W3C Proposal :