Advanced XML
- Outline
- Please turn off all
- Part I: XML Infoset
- A normal XML document
- A canonical XML document
- An org.w3c.dom.Document object formed by reading hotcop.xml
- Are these three the same thing or not?
- What is the XML InfoSet?
- The InfoSet defines 11 kinds of Information Items
- The Document Information Item
- Elements
- Element Information Items
- Attributes
- Comments
- A Processing Instruction Information Item Includes:
- Characters
- Namespaces
- Document Type Declaration
- Document Type Definition
- Entities
- Entity Information Items
- Unparsed Entity Information Items
- Unexpanded Entity Information Items
- The InfoSet Omits:
- Canonical XML
- How are documents canonicalized?
- Canonicalization software
- Questions?
- Digital Signatures
- Not Just for Signing XML
- Signature Process
- XML Digital Signature software
- A Detached Signature for hotcop.xml
- To Learn More
- Part II: Schemas
- What are Schemas?
- About Schemas
- What's Wrong with DTDs?
- Schema versions
- greeting.xml
- greeting.xsd
- Attaching the schema to the document without namespaces
- Validating the document with Xerces-J 1.3.0
- An Invalid Document
- Checking the Invalid Document
- A More Complex Document
- Complex vs. Simple Types
- Three main schema elements:
- A More Complex Schema
- Validating the Song Document
- Fixed Hot Cop
- A Smaller Schema
- Anonymous Types
- Questions?
- Data Typing
- Possible types
- The PSVI
- Primitive Data Types for Schemas
- Numeric Data Types for Schemas
- Time Data Types for Schemas
- XML Data Types for Schemas
- Assorted Data Types for Schemas
- Derived Types
- Facets
- Facets for strings: length, minLength, maxLength
- Facets for ordered items:
minExclusive, maxExclusive, minInclusive, maxInclusive
- whiteSpace
- Facets for decimal numbers: totalDigits and fractionDigits
- Facets for time: period and duration
- Enumeration
- Adding a Price
- The pattern facet
- Regular Expressions
- The Price Schema
- Questions?
- Complex Types
- A Document with Attributes
- Declaring Attributes
- Element Content
- Declaring Complex Types
- Sharing Content Models
- Mixed Content
- Declaring Mixed Content
- Questions?
- When Order Doesn't Matter
- The xsd:all Group
- Choices
- Sequences
- Questions?
- Default Namespace
- The targetNamespace attribute
- A Song with a Namespace
- A Schema for a Document that Uses the Default Namespace
- Multiple Namespaces, Multiple Schemas
- XLink Schema
- Song Schema with XLink Support
- Annotations
- What Schemas don't do
- Schema Alternatives
- Schematron
- A Schematron schema for songs
- RELAX
- A RELAX schema for songs
- TREX
- Hook
- DTDs aren't Dead!
- To Learn More
- Questions?
- Part III: XSLT 1.1 and Beyond
- XSLT 1.1
- Identifying 1.1 compliant stylesheets
- No result tree fragments
- Multiple Output Documents
- xsl:document Example
- xsl:script Top-level Element
- xsl:script with Java
- xsl:script with JavaScript
- XPath 2.0
- XPath 2.0 Goals
- XPath 2.0 Requirements
- XSLT 2.0
- XSLT 2.0 Goals
- XSLT 2.0 Non-goals
- XSLT 2.0 Requirements
- XQuery
- XQuery Language
- Documents to Query
- Physical Representations to Query
- Where is XQuery used?
- The XML Model vs. the Relational Model
- Query Data Types
- An example document to query
- Bibliography DTD
- The XQuery FLWR
- Query: List titles of all books
- Query Result: Book Titles
- Element Constructors
- Query Result: Book Titles
- Query with WHERE
- Query Result: Titles of books published by Addison-Wesley
- Query with Booleans
- Query Result: books published by Addison-Wesley after 1993
- Attribute Constructors
- Query Result: books published by Addison-Wesley after 1993,
including their year and
title.
- Query with multiple variables
- Query Result: A list of all the title-author pairs
- Nested Queries
- Query Result: A list of
the title and authors of each book in the bibliography
- Query with distinct
- Query Result
- IF THEN ELSE
- Query Result: Books with the first two authors
- Query with sorting
- Query Result
- Queries with string functions
- Query Result
- A different document about books
- This document uses a different DTD
- Query that joins two documents
- Result
- Prices DTD
- prices.xml Query Sample Data
- Query with reused variables
- Query Result
- Multiple FLWR Queries
- Query Result
- Query Software
- To Learn More
- Questions?
- Part IV: DOM Level 3
- Trees
- Document Object Model
- DOM Evolution
- DOM Parsers for Java
- Eight Modules:
- DOM Trees
- The Core: org.w3c.dom
- The Node Interface
- The NodeList Interface
- Node Reporter
- Node Reporter Output
- Node Values as returned by getNodeValue()
- Questions?
- New Features in DOM Level 3
- DOM Level 3 Core Additions
- DOMKey
- Node3
- Entity3
- Document3
- Text3
- Questions?
- Bootstrapping
- DOM3 Bootstrapping
- Questions?
- Load and Save
- The DOM Process
- Parsing documents with DOM2
- Parsing documents with DOM3
- Load and Save
- DOMImplementationLS
- DOMBuilder
- DOMInputSource
- DOMEntityResolver
- DOMWriter
- DOMBuilderFilter
- Questions?
- Grammar Access/Content Models
- Content Model Interfaces
- Content Model and CM-Editing Interfaces
- The CMModel Interface
- The CMExternalModel Interface
- The CMNode Interface
- The CMNodeList Interface
- The CMNamedNodeMap Interface
- The CMDataType Interface
- The ElementDeclaration Interface
- The CMChildren Interface
- The AttributeDeclaration Interface
- The EntityDeclaration Interface
- The CMNotationDeclaration Interface
- Validation and Other Interfaces:
- The Document Interface
- The DocumentCM Interface
- The DOMImplementationCM Interface
- Document-Editing Interfaces:
- The NodeCM Interface
- The ElementCM Interface
- The CharacterDataCM Interface
- The DocumentTypeCM Interface
- The AttributeCM Interface
- Questions?
- DOM Error Handler Interfaces
- The DOMErrorHandler Interface
- The DOMLocator Interface
- To Learn More
- Questions?
- Part V: JDOM
- Where we're going
- Trees
- Processing XML with JDOM is easy
- What is JDOM?
- About JDOM
- JDOM versions
- Four packages:
- The org.jdom package
- The org.jdom.input package
- The org.jdom.output package
- The org.jdom.adapters package
- Writing XML Documents with JDOM
- A JDOM program that writes this XML document
- Hello JDOM
- Actual Output
- Hello DOM
- A Java program that writes Fibonacci numbers into a text file
- fibonacci.txt
- fibonacci.xml
- A JDOM program that writes Fibonacci numbers into an XML file
- Output
- A DOM program that writes Fibonacci numbers into an XML file
- Suppose you want to include a DTD
- ValidFibonacci
- validfibonacci.xml
- Using Namespaces
- With Namespace Prefixes
- The Default, Unprefixed Namespace
- With Default Namespace
- Converting data to XML
- Sample Tab Delimited Data: Baseball Statistics
- A Program to convert tab delimited data to XML
- Baseball Stats in XML
- A Shortcut
- Converting data to XML while Processing it
- Batting Averages in XML
- Advantages of JDOM for Writing Documents
- Reading XML with JDOM
- Parser APIs
- JDOM Compatible Parsers for Java
- SAX
- SAX2
- The SAX Process
- Event Based API Caveats
- Document Object Model
- The Design of the DOM API
- DOM Evolution
- Eight Modules:
- DOM Trees
- org.w3c.dom
- The DOM Process
- The JDOM Process
- Parsing a Document with JDOM
- Parser Results
- Turning on Validation in JDOM
- JDOM Validator
- Validation Output
- Building with DOM instead of SAX
- DOMBuilder Example
- Reading XML Documents
- UserLand's RSS based list of Web logs
- Goal: Return a list of all the URLs in this
list as java.net.URL objects
- The SAX ContentHandler interface
- SAX Design
- User Interface Class
- ContentHandler Class
- Weblogs Output
- Weblogs with DOM
- DOM Design
- The Node Interface
- The NodeIterator Interface
- The NodeFilter Interface
- Weblogs with DOM
- Weblogs Output
- Weblogs with JDOM
- JDOM Design
- Weblogs with JDOM
- Weblogs Output
- The org.jdom Package
- The Document Node
- The Document Class
- Document Example
- Output from XMLPrinter
- Element Nodes
- Element Class Implementation
- The Element Class
- Element Example: XCount
- XCount Output
- Handling Attributes in JDOM
- The Attribute Class
- IDTagger
- Before IDTagger
- After IDTagger
- Handling Entities in JDOM
- The Entity Class
- Handling Comments in JDOM
- The Comment Class
- Comment Example
- CommentReader Output
- ProcessingInstruction Nodes
- The ProcessingInstruction Class
- XLinkSpider that Respects the robots Processing Instruction
- Handling Namespaces
- The Namespace Class
- The Namespace Class
- DocType Nodes
- The DocType class
- Example of the DocType Class
- XHTMLValidator
- Using the XHTMLValidator
- The Verifier Class
- The Verifier Class
- JDOMException
- JDOMException Class
- The org.jdom.output Package
- Serialization
- XMLOutputter
- Using the XMLOutputter Class Directly
- Using the XMLOutputter Class Indirectly
- JDOM based TagStripper
- Output from a JDOM based TagStripper
- Talking to DOM Programs
- Talking to SAX Programs
- What JDOM doesn't do
- To Learn More
- Questions?
- Part VI: XML Hypertext
- HTML Hypertext is Limited
- XML Hypertext
- XML Hypertext Example
- Versions
- Part I: XLinks
- XLinks are More Powerful
- Application Support
- Linking Elements
- For example
- Declaring XLink Attributes in DTDs
- Fixed Attributes
- Other Attributes
- Questions?
- Descriptions of the Remote Resource
- Link Behavior
- xlink:show
- xlink:actuate
- Parameter Entities for Link Attributes
- Questions?
- Extended Links
- Extended Links
- Resources
- Resource Example
- Resource Example Diagram
- Roles and Titles for Resources
- DTD for Extended Links
- Another Shortcut for the DTD
- Arcs
- Arc Example
- Arc Example Diagram
- Arc Example
- Arc Example Diagram
- Arc Example with omitted to attribute
- Arc Example Diagram
- Arc DTD Fragment
- Out-of-Line Links
- Out of line Link example
- Out of line Link example
- Out of line Link Example
- Another Out of line Link Example
- Linkbases
- XLink Summary
- To Learn More
- Questions?
- Part II: XPointers
- XPointers
- What are XPointers?
- Why Use XPointers?
- XPointer Examples
- XPointers in URIs
- XPointers in XLinks
- A Concrete Example
- Location Paths, Steps, and Sets
- Location Steps
- Location Paths
- Location Paths that Identify Multiple Nodes
- Axes
- Location Step Axes
- Node Tests
- Predicates
- Boolean Conversion
- The position() function
- Identifying an element by its position
- Functions that Return Node Sets
- id()
- here()
- origin()
- Points
- Point Expressions
- Ranges
- Range Expressions
- Range Functions
- String Ranges
- XPointers and Namespaces
- Child Sequences
- XPointer Summary
- To Learn More
- Questions?
- Part III: XML Base
- What is XML Base?
- The xml:base attribute
- XML Base Example
- Open Issues
- To Learn More
- Questions?
- Part IV: XInclude
- What is XInclude?
- Alternatives (and why they don't work)
- The include element
- The parse attribute
- Implementation as JDOM
- Implementation as DOM
- To Learn More
- Questions?
- Part VII: The Oracle Speaks, Predictions for the Future
- XSLT 1.1 as successful as XSLT 1.0
- XSLT 2.0
- XQuery
- XInclude succeeds once parsers support it
- DOM Level 3 succeeds
- JDOM succeeds, much to the consternation of
the W3C
- Schemas, a partial success
- Stuff we didn't talk about
- XLinks
- XPointers; the same story
- XSL-FO
- XHTML Fails
- Schema Repositories all fail
- MathML succeeds
- SVG Takes Off in 2001
- Browser Support
- Invent the Future!
- To Learn More
- Questions?
Entire Presentation as Single File
Copyright 2000, 2001 Elliotte Rusty Harold
Last Modified April 6, 2001