XML Document Design
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 1:
Introduction to XML
Copyright © 2002 ProsoftTraining. All rights reserved.
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
What
Is XML?
• Extensible Markup Language
• Hypertext Markup Language
• Tags
<golfer tour=“PGA”> Tiger Woods </golfer>
Markup
Languages
• Markup
• WYSIWYG
SGML
Roots
• STML and HTML
– Meta-language
• HTML went astray
• HTML tried to recover its vision
– Cascading Style Sheets
• SGML and XML
– Extensible Stylesheet Language
XML
Directives
• Design goals for XML
• XML implementation
XHTML,
XML and HTML
• Extensible Hypertext Markup
Language 1.0
– No tags
XML
Development Organizations
•
•
•
•
W3C
Oasis
BizTalk
XML.org
• Arbortext
• Microsoft XML Web
Services
• IBM XML Zone
• Apache XML Project
XML Parsers
and Browsers
• Parsers
– Validating
– Non-validating
• Browsers
– Mozilla
– Microsoft Internet Explorer 6
– Opera
– Netscape Navigator 7
XML Alone
Is Insufficient
• No linking capability
• No formatting capabilities
• XML documents are abstract
– EDI
Implementing XML
• XML schema
• Development tools
Benefits
of 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
Lesson 2:
Well-Formed
XML Documents
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Construct XML documents
• Explain the differences between tags and
elements in XML
• Specify the five rules for creating a wellformed 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 and
Elements in XML
Rules for
Well-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
Tag
Nesting
Discerning
Structure
• XML character strings
– Character data
• White space
• The root (or document) element
• Tree structure of a well-formed document
Tree
Structure
C AT AL O G
BOOK
T IT L E
AU T H O R
Y E AR -P U B L IS H E D
IS B N
Working with
Mixed Content
• Creating a well-formed XML document from
text
• Adding comments to XML documents
• XML encoding
Balkanization
of 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 wellformed XML document
 Convert an HTML document into an XHTML
file
 Create a well-formed XML document
Lesson 3:
Creating a
Valid XML Document
Copyright © 2002 ProsoftTraining. All rights reserved.
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
Document
Object Model
• Core Level 1
• HTML Level 1
Document
Type Definition
• The root element
• Element type declarations
– #PCDATA
– Child elements
– Element content
– Mixed content
– Empty elements
Referencing DTD
Definitions in XML
• DOCTYPE declaration
• Internal DTD
• External DTD
Declaring
Attributes 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
Lesson 4:
XML Parsers
Copyright © 2002 ProsoftTraining. All rights reserved.
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-Line
Parsing
• Verifies document compliance with wellformedness 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
Lesson 5:
The XML Family
of Technologies
Copyright © 2002 ProsoftTraining. All rights reserved.
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
The
XML Family
•
•
•
•
Namespaces in XML
XLink
XPath
XPointer
Namespaces
in 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
XPath
Expressions
• 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
XForms
and 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
Lesson 6:
XSL Transformation
Copyright © 2002 ProsoftTraining. All rights reserved.
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, XSLT
and Style Sheets
• Extensible Stylesheet Language
Transformation
• Formatting objects (flow objects)
• Transformation languages
• XSLT processing
• XSLT namespace
XSLT
Document Structure
•
•
•
•
Style sheet element and namespace
Templates
apply-templates
select
Transforming
Data: XML to XML
•
•
•
•
Scenario
Models
Solution
Element transformation
Saxon
XSLT Processor
• Running Saxon
• Processing XSLT using Saxon
• Converting XML data structure using XSLT
Transforming
Data: XML to HTML
•
•
•
•
Advanced matching and selecting
Top-level elements
Instruction elements
Comments
Multiple
Document 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
Lesson 7:
XML Formatting
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
Define XML formatting requirements
Apply CSS to XML
Use XSL flow objects and patterns
Apply XSL to XML
Convert XSL into PDF
XML
Styling
• Cascading Style Sheets
• Extensible Stylesheet Language
– Language for transforming XML documents
– Vocabulary for specifying formatting
semantics
XML
and CSS
• The absence of predefined formatting
eliminates conflicts between inherent element
properties and style properties in XML
CSS
Syntax
• Selectors
• CSS1
• XML and CSS tools
XML
and XSL
• Areas
• Indents
Formatting
Objects
• 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
XSL
Page 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
Page
Layout (cont’d)
• fo:block
• fo:list-block
• fo:table
XML, XSL and
Formatting Objects
• Transforming an XML document
• Processing an XSL style sheet
Converting XSL
Flow 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
Lesson 8:
XML Schemas
Copyright © 2002 ProsoftTraining. All rights reserved.
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
Data
Types
• Built-in data types
• User-defined data types
Schema
Element
•
•
•
•
•
•
•
The targetNamespace attribute
The elementFormDefault attribute
Document instance schema reference
Undeclared target namespaces
Annotation
Element declarations
Element references
ComplexType
vs. 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
Lesson 9:
Extensible Hypertext
Markup Language (XHTML)
Copyright © 2002 ProsoftTraining. All rights reserved.
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?
XHTML
Definition Variations
• XHTML document declarations
– Document type declaration
XHTML
Conformance Requirements
•
•
•
•
•
Correct case
Root element
Empty elements
Nesting
Fragment identifiers
XHTML 1.1
and 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
Lesson 10:
XML Tools
Copyright © 2002 ProsoftTraining. All rights reserved.
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
XML
Tools
• Simple tools  XML Notepad
• Complete tools  Arbortext Epic,
XML Spy
Tool
Types
• Command-line tools
• Visual tools
• Graphical tools
HTML to
Well-Formed XML
• Cleaning an HTML document
with TidyGUI
Creating
a DTD
• Creating an XML DTD with SML Spy
Creating
a Schema
• Creating an XML schema with XML Spy
Importing
Database 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 Project
Management Guidelines
• Development
– Design the required DTD
– Develop style sheets
– Store in a repository
• Staffing
– Project managers
– Application developers
– Format/layout designers
– Content authors
XML-Driven
Technologies
• 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
XML
Document Design





Introduction to XML
Well-Formed XML Documents
Creating a Valid XML Document
XML Parsers
The XML Family of Technologies
XML
Document Design




XSL Transformation
XML Formatting
XML Schemas
Extensible Hypertext Markup Language
(XHTML)
 XML Tools
Descargar

Document