Java XML Processing
Introduction Java XML Processing Agenda Summary of XML Basic Concepts 7 XML statements A brief history of XML XML vs. SGML XML vs. HTML XML vs. SGML vs. HTML vs. XHTML XML advantages XML uses Structure of an XML document Criteria for well-formedness A test for proper nesting ? OK A test for proper nesting ? NOK! XML namespaces Additional remarks on XML syntax XML schemas Validity of XML documents XML schema languages Rendering XML using XSLT XSLT-XPath interaction XSLT Structure A simple XSLT transformation How does XSLT work? How does XSLT work The XSLT data model Structure of an XSLT document The XSLT translation process A complete example Steps in an XSLT application XSLT Example Essential XSLT elements XPath examples Displaying XML with CSS XSL:FO (Formatting Objects) XML to XSL-FO with XSLT The XSL-FO transformation Rendering engine: Apache FOP XSL-FO document overview The transformation process XSL-FO document structure XSL-FO example XML support in Office 2003 WordML and other technologies Physical storage of XML data Example of XML support in SQL Server 2005 Overview of Java APIs for XML Overview Comparing SAX to DOM Example The JAXP packages The JAXP JAR files XML Uses and Best Practices XML uses in applications Using patterns: Builder Using patterns: Visitor SAX: Simple API for XML SAX Anatom y of a SAX application SAX structure SAX callback mechanism SAXParser instantiation class DefaultHandler ContentHandler interface Notes on ContentHandler methods SAX exception handling Additional event handling Additional event handling SAX Example XML and Java Workshop Workshop proposals Exercise DOM: Document Object Model DOM What is DOM? The DOM Tree Structure Tree View of an XML Document Anatom y of a DOM application DOM Structure DocumentBuilder instantiation DOM interfaces The Document interface DOM exception handling DOM Level 2 and 3 Exercise StAX: Streaming API for XML Pull-type streaming API: StAX Obtaining StAX Anatom y of a StAX application StAX example StAX event types StAX event interfaces Testing StAX events Document output with StAX Exercise JDOM: Java Document Object Model Why another tree-based API? The core JDOM classes Constructors Input and output Input examples Output examples Creating documents and elements Reading and accessing elements The Namespace Class examples Other possibilities of JDOM Exercise TrAX: Transformer API for XML TrAX JAXP XSLT Structure: TraX How does the TrAX API work Steps in a TrAX API application TrAX API Example Exercise JAXB: Java Architecture for XML Binding JAXB: Java Architecture for XML Binding Marshalling and unmarshalling JAXB example Data binding, metadata and Schemas When to use data binding JAXB 1.0 overview JAXB 2.0 overview Finding JAXB Working with JAXB: the JAXBContext Compiling a Schema The inverse: Creating a Schema from class Simple marshalling Simple unmarshalling Schema validation when marshalling More advanced JAXB uses Exercise Java XML Web Services What is a web service? History Advantages Disadvantages XML technologies involved The SOAP protocol The WSDL descriptor Web services in Java JAX-WS JAX-WS example Exercise Conclusion