Download presentation
Presentation is loading. Please wait.
Published byLawrence Bryer Modified over 9 years ago
1
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)
2
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...
3
2. Well-Formed XML An XML document is called well-formed if 1. It starts with the XML prolog, i.e.... 2. The tags are properly nested, 3. There is exactly one root element,... The XML spec : http://www.w3.org/TR/REC-xml
4
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 : http://www-tei.uic.edu/orgs/tei/sgml/teip3sg/
5
4. Encodings Drei Sonaten und drei Partiten für Violine solo Bärenreiter … ISO-8859-1, 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: http://www.unicode.org/
6
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 : http://www.w3.org/TR/REC-xml-names/
7
6. XML Schema …... XML Schema Part 1: Structures : http://www.w3.org/TR/xmlschema-1/ XML Schema Part 2: Datatypes : http://www.w3.org/TR/xmlschema-2/
8
7. XML Tools XML Parsers expat, James Clark, C, http://www.jclark.com/xml/expat.html XP, James Clark, Java, http://www.jclark.com/xml/xp/ IE5 XJParser, DataChannel, http://xdev.datachannel.com/downloads/xjparser/ XML Editors Notepad XMetaL, SoftQuad, http://www.softquad.com/products/xmetal/index.html Adept, Arbortext, http://www.arbortext.com/Products/ ADEPT_Series/adept_series.html
9
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("http://pcjhb.software-ag.de/xml/closedXml/instances/m1.xml");... import org.xml.sax.HandlerBase; import org.xml.sax.AttributeList; public class MyHandler extends HandlerBase { public void startElement (String name, AttributeList atts) {... SAX Homepage : http://www.megginson.com/SAX/
10
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 : http://www.w3.org/TR/REC-DOM-Level-1/
11
10. Stylesheets …...... XSL spec : http://www.w3.org/TR/WD-xsl/ The W3C’s CSS Homepage : http://www.w3.org/Style/CSS/ DSSSL Page at Mulberry Technologies : http://www.mulberrytech.com/dsssl/index.html
12
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 : http://www.w3.org/TandS/QL/QL98/pp/xql.html
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.