Objectives of the training
This training course aims to develop in-depth expertise in the use of XML in Java applications. It enables participants to acquire the skills needed to manipulate XML formats via the DOM, SAX, and XSLT APIs, while understanding their differences and impact on performance. It also covers alternatives such as STAX, JDOM, and DOM4J for more tailored use depending on project requirements.Targeted audience
Java developersPrerequisite
Basic knowledge of XML structure and syntax. Basic knowledge of XPath and XML schemas. Know how to create and manipulate classes, objects, interfaces, and exceptions. (Object-oriented training, not necessarily Java) Knowledge of collections (List, Map, Set) and iterators. Proficiency in input/output (I/O), particularly reading/writing text and binary files.Trainers
Benefits for Participants
• Understand the positioning of XML in a Java EE architecture
• Know the differences in usage between SAX and DOM
• Know how to develop SAX parsing with events and callback methods
• Know how to implement a DOM tree to read and write to a document
• Know how to implement an XSLT transformation with TRAX
• Know how to implement JAXP and TRAX access factories
• Know how to generate a PDF document with XSL-FO and the FOP parser
• Have a basic understanding of alternative technologies for XML parsing: JDOM, DOM4J, STAX, COCOON
Course architecture
Positioning XML in Java EE XML architectures
• Standards for manipulating XML documents: XML, XSL, DTD, Schema
• Building a well-formed XML document: syntax rules for writing
• Building a valid document: checking grammar with DTDs or Schema
• Transforming XML documents with XSLT sheets: transformation rules
• Positioning XML in information systems
• XML for standardized data exchange between applications: EAI integration
• XML and publishing data in different formats: HTML, PDF, others
• The issue of mapping relational RDBMS data to XML documents
• The problem of mapping object formats with XML documents
• Performance constraints and best practices for using XML formats in an IS
• JAVA APIs for manipulating XML documents
• XML parsing APIs: SAX, DOM, JDOM
• Java XML parsers: Xerces and Xalan
• XSLT transformation APIs and frameworks: TRAX, COCOON
• OO-XML mapping APIs: JAXB, CASTOR
• XML-RDBMS mapping APIs
SAX Parsing of XML Documents
• Introduction to the SAX and JAXP APIs
• The SAX API: the event-driven approach and callback methods
• The main API interfaces: ContentHandler, DTDHandler, EntityResolver, ErrorHandler
• JAXP abstraction layer provided by SUN for accessing the SAX parser
• SAX parsing features
Parsing the document with the DefaultHandler helper
• Parsing namespaces and DTD entities
• Validating the document with a DTD or XML schema
• Error handling with the ErrorHandler interface
• Using XMLFilters to modify the SAX event stream
Comparison with XML Streaming
• Introduction to SUN's new STAX API
• Introduction to the main Streaming APIs
DOM parsing of XML documents
• Presentation of the DOM and JAXP APIs
• Presentation of the DOM API: loading the document into an object tree
• Comparison of DOM and SAX: appropriate use of each API
• Presentation of the main API interfaces: the Node, Document, and Element interfaces
• JAXP abstraction layer provided by SUN for accessing the DOM parser
DOM parsing features
• Accessing nodes with tree functions: Node, NodeList, Element, Text, Attr
• Accessing nodes in the document with XPATH expressions
• Creating new nodes and assembling them in the tree with Document
• Event management on a DOM tree: Event and EventListener
• Persistence of changes made to the tree
Comparison with other tree and DOM mapping technologies
• Comparison with JDOM: advantages and disadvantages
• Comparison with DOM4J: advantages and disadvantages
• JAXB API: Mapping an XML document to a DOM tree
XSLT transformation on an XML document
• Introduction to XSL and the TRAX API
• Reminders about XSL stylesheets and the XPATH language
• Introduction to the TRAX API: encapsulating and organizing access to the XALAN XSLT parser
XSLT parser features
• Implementing XSLT transformations with different sources and results: SAX, DOM, Stream
• Implementing XSLT transformations with parameters on the TRAX engine
• Implementing compiled XSLTC sheets
• Integrated grammar validation and error handling
Generating PDF documents with XSL-FO
• Introduction to the XSL-FO standard and main tags
• Introduction to the FOP parser and interaction with XSLT parsers
• XSL, XSLT, XSL-FO transformation pipeline
Comparison with the COCOON framework
• Introduction to the COCOON framework: automating XSLT transformations
• Implementation of automatic transformation pipelines
Pedagogical details
Type of training
Private or personalized training
If you have more than 8 people to sign up for a particular course, it can be delivered as a private session right at your offices. Contact us for more details.
Request a quotePrivate or personalized training
If you have more than 8 people to sign up for a particular course, it can be delivered as a private session right at your offices. Contact us for more details.
Request a quote