Upload
nigel-turner
View
218
Download
0
Embed Size (px)
Citation preview
Copyright © 2002 ProsoftTraining. All rights reserved.
XML Document Design
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 1:Introduction to XML
Objectives
• Explain the basic concepts of markup languages
• List the goals of XML• Describe the relationship between XML and
HTML• Name the organizations that govern and
contribute to XML development• Define XHTML• Identify browsers that support XML
WhatIs XML?
• Extensible Markup Language• Hypertext Markup Language• Tags <golfer tour=“PGA”> Tiger Woods </golfer>
MarkupLanguages
• Markup• WYSIWYG
SGMLRoots
• STML and HTML– Meta-language
• HTML went astray• HTML tried to recover its vision
– Cascading Style Sheets• SGML and XML
– Extensible Stylesheet Language
XMLDirectives
• Design goals for XML• XML implementation
XHTML,XML and HTML
• Extensible Hypertext Markup Language 1.0– No tags
XMLDevelopment Organizations
• W3C• Oasis• BizTalk• XML.org
• Arbortext• Microsoft XML Web
Services• IBM XML Zone• Apache XML Project
XML Parsersand Browsers
• Parsers– Validating– Non-validating
• Browsers– Mozilla– Microsoft Internet Explorer 6– Opera– Netscape Navigator 7
XML AloneIs Insufficient
• No linking capability• No formatting capabilities• XML documents are abstract
– EDI
Implementing XML
• XML schema• Development tools
Benefitsof XML
• One source• Management of metadata• Universal representation and meaning• Management of content• One to many• Database publishing
Summary
Explain the basic concepts of markup languages
List the goals of XML Describe the relationship between XML and
HTML Name the organizations that govern and
contribute to XML development Define XHTML Identify browsers that support XML
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 2:Well-Formed
XML Documents
Objectives
• Construct XML documents• Explain the differences between tags and
elements in XML• Specify the five rules for creating a well-
formed XML document• Convert an HTML document into an XHTML
file• Create a well-formed XML document
What Is an XML Document?
• HTML: The lazy developer’s dream• XML: The lazy developer’s nightmare
Tags andElements in XML
Rules forWell-Formed XML
• Opening and closing tags• New rules for empty tags• Attribute values• Nesting• Matching case between tags• Simple well-formed XML• XHTML: Stepping stone to XML
TagNesting
DiscerningStructure
• XML character strings– Character data
• White space• The root (or document) element• Tree structure of a well-formed document
TreeStructure
T IT LE
AUT HOR
YEAR-PUBLISHED
ISBN
BOOK
CATALOG
Working withMixed Content
• Creating a well-formed XML document from text
• Adding comments to XML documents• XML encoding
Balkanizationof the Web
• Confusing assortment of tags resulting from numerous tagging schemes
Summary
Construct XML documents Explain the differences between tags and
elements in XML Specify the five rules for creating a well-
formed XML document Convert an HTML document into an XHTML
file Create a well-formed XML document
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 3:Creating a
Valid XML Document
Objectives
• Define the DTD• Define the DOM• Identify DTD declarations• Create a DTD• Validate an XML document• Create an XML file that conforms to a DTD• Use DTD repositories
Beyond Well-Formedness:Valid XML Documents
• Valid conformance with a Document Type Definition– Rules that define the structure, syntax and
vocabulary related to tags
DocumentObject Model
• Core Level 1• HTML Level 1
DocumentType Definition
• The root element• Element type declarations
– #PCDATA– Child elements– Element content– Mixed content– Empty elements
Referencing DTDDefinitions in XML
• DOCTYPE declaration• Internal DTD• External DTD
DeclaringAttributes in a DTD
• Attribute-list declarations• Commonly used attribute types• Entities• Parameter entities• Notation declarations
Pre-Existing DTDs
• XML/DTD repositories
Summary
Define the DTD Define the DOM Identify DTD declarations Create a DTD Validate an XML document Create an XML file that conforms to a DTD Use DTD repositories
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 4:XML Parsers
Objectives
• Explain the requirements for a parser• Identify the differences between validating and
non-validating parsers• Use online parsers• Use command-line parsers
Parsers
• Also known as processors• Varying levels of conformance• Object-based parsers• Event-based parsers• Validating parsers• Non-validating parsers
Command-LineParsing
• Verifies document compliance with well-formedness requirements and DTD
Summary
Explain the requirements for a parser Identify the differences between validating and
non-validating parsers Use online parsers Use command-line parsers
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 5:The XML Familyof Technologies
Objectives
• Define XML namespaces and usage• Explain the XPath recommendation• Explain the XLink recommendation• Explain the XPointer recommendation• Describe the XForms and XML Query
proposals
TheXML Family
• Namespaces in XML• XLink• XPath• XPointer
Namespacesin XML
• Namespace components• Explicit and implicit namespace declaration• Multiple namespaces• Inline namespace declaration• Namespace scope/inheritance• Namespaces and DTDs• Namespace attributes
XPath
• XML Path Language• XPath nodes
– Document– Root– Element– Attribute– Text– Processing instruction– Namespace– Comment
XPathExpressions
• Operand• Location paths
– Context node• Function calls
– Predicate
XLink
• XML Linking Language– Simple links– Extended links– Locators– Arcs– Resources– Titles
• Link behavior
XPointer
• Fragment identifier• Tracing a path• Shorthand notation• Shorthand syntax• Formal XPointer syntax• Range or portion selection
XFormsand XML Query
• XForms– New generation of forms introducing
business logic, calculations, and form processing
• XML Query– Based pm XML Infoset
Summary
Define XML namespaces and usage Explain the XPath recommendation Explain the XLink recommendation Explain the XPointer recommendation Describe the XForms and XML Query
proposals
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 6:XSL Transformation
Objectives
• Describe the relationship between XSL and XSLT
• Use XSLT templates and patterns• Convert XML to a new XML output document• Reorganize XML data to an output file• Convert XML to HTML• Compile remote data sources into an XML
output file
XSL, XSLTand Style Sheets
• Extensible Stylesheet Language Transformation
• Formatting objects (flow objects)• Transformation languages• XSLT processing• XSLT namespace
XSLTDocument Structure
• Style sheet element and namespace• Templates• apply-templates• select
TransformingData: XML to XML
• Scenario• Models• Solution• Element transformation
SaxonXSLT Processor
• Running Saxon• Processing XSLT using Saxon• Converting XML data structure using XSLT
TransformingData: XML to HTML
• Advanced matching and selecting• Top-level elements• Instruction elements• Comments
MultipleDocument Sources
• The document () function
Summary
Describe the relationship between XSL and XSLT
Use XSLT templates and patterns Convert XML to a new XML output document Reorganize XML data to an output file Convert XML to HTML Compile remote data sources into an XML
output file
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 7:XML Formatting
Objectives
• Define XML formatting requirements• Apply CSS to XML• Use XSL flow objects and patterns• Apply XSL to XML• Convert XSL into PDF
XMLStyling
• Cascading Style Sheets• Extensible Stylesheet Language
– Language for transforming XML documents– Vocabulary for specifying formatting
semantics
XMLand CSS
• The absence of predefined formatting eliminates conflicts between inherent element properties and style properties in XML
CSSSyntax
• Selectors• CSS1• XML and CSS tools
XMLand XSL
• Areas• Indents
FormattingObjects
• Types– Those that generate block and inline areas– Those that return areas but do not generate
them– Those that are used to generate layout
areas
XSLPage Layout
• fo:layout-master-set• fo:simple-page-master• fo:region• fo:page-sequence-master
and fo:page-sequence• fo:page-sequence-master sub elements• Content flow objects
PageLayout (cont’d)
• fo:block• fo:list-block• fo:table
XML, XSL andFormatting Objects
• Transforming an XML document• Processing an XSL style sheet
Converting XSLFlow Objects to PDF
• Portable Document Format• Formatting Object Processor
Summary
Define XML formatting requirements Apply CSS to XML Use XSL flow objects and patterns Apply XSL to XML Convert XSL into PDF
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 8:XML Schemas
Objectives
• Explain the purpose of schemas• Explain data types and facets• Define attributes and references• Define simple and complex elements• Create an XML schema
Schemas
• XML Schema
Components
• Schema component categories– Definition components– Declaration components– Model group components– Annotation component
DataTypes
• Built-in data types• User-defined data types
SchemaElement
• The targetNamespace attribute• The elementFormDefault attribute• Document instance schema reference• Undeclared target namespaces• Annotation• Element declarations• Element references
ComplexTypevs. SimpleType
• ComplexType– Elements that contain sub-elements or
carry attributes• SimpleType
– Elements that contain numbers but do not contain sub-elements or attributes
Attributes
• The content attribute• User-defined attributes
Facets
• Fourteen facets defined by XML Schema
Grouping
Element
Element
Element
Summary
Explain the purpose of schemas Explain data types and facets Define attributes and references Define simple and complex elements Create an XML schema
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 9:Extensible Hypertext
Markup Language (XHTML)
Objectives
• Identify the reasons for XHTML's development• Identify key features of XHTML documents• Create XHTML documents
HTML vs. XML
• Clients• Browser forgiveness• What does HTML forgive?
– Case-sensitivity– Nesting– Closing elements– Attributes
• What does XML not forgive?
XHTMLDefinition Variations
• XHTML document declarations– Document type declaration
XHTMLConformance Requirements
• Correct case• Root element• Empty elements• Nesting• Fragment identifiers
XHTML 1.1and Modules
• XHTML 1.1 versus XHTML (Second Edition)• W3C-approved modules for XHTML 1.1• W3C-approved sub-elements for XHTML 1.1• XHTML 2.0 (2003)
Summary
Identify the reasons for XHTML's development Identify key features of XHTML documents Create XHTML documents
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 10:XML Tools
Objectives
• Use XML tools to clean existing documents• Use a DTD editor• Use an editor to create XSL and schemas• Import database information for XML
conversion• Use graphical editors to create XML
documents• Convert XML to various outputs• Define SOAP and BizTalk
XMLTools
• Simple tools XML Notepad• Complete tools Arbortext Epic,
XML Spy
ToolTypes
• Command-line tools• Visual tools• Graphical tools
HTML toWell-Formed XML
• Cleaning an HTML document with TidyGUI
Creatinga DTD
• Creating an XML DTD with SML Spy
Creatinga Schema
• Creating an XML schema with XML Spy
ImportingDatabase Information
• Importing database data• Editing XML code with Epic Editor• Styles• Creating XSL style sheets• One-to-many output• Creating multiple output files from XML
XML ProjectManagement Guidelines
• Development– Design the required DTD– Develop style sheets– Store in a repository
• Staffing– Project managers– Application developers– Format/layout designers– Content authors
XML-DrivenTechnologies
• Simple Object Access Protocol• BizTalk
Summary
Use XML tools to clean existing documents Use a DTD editor Use an editor to create XSL and schemas Import database information for XML
conversion Use graphical editors to create XML
documents Convert XML to various outputs Define SOAP and BizTalk
XMLDocument Design
Introduction to XML Well-Formed XML Documents Creating a Valid XML Document XML Parsers The XML Family of Technologies
XMLDocument Design
XSL Transformation XML Formatting XML Schemas Extensible Hypertext Markup Language
(XHTML) XML Tools