Session 2

XML for Java Developers
G22.3033-002
Session 2 - Main Theme
Markup Language Technologies (Part II)
Dr. Jean-Claude Franchitti
New York University
Computer Science Department
Courant Institute of Mathematical Sciences
1
Agenda
„
Summary of Previous Session / Review New Syllabus
„
XML Applications vs. Applications of XML!?
„
History and Current State of XML Standards
„
Advanced Applications of XML
„
XML’s eXtensible Style Language (XSL)
„
Character Encodings and Text Processing
„
XML and DBMSs
„
Course Approach ...
„
XML Application Development
„
XML References and Class Project
„
Readings
„
Assignment #1a (due today - reminder?)
„
Assignment #1b (due next week)
2
1
Summary of Previous Session
„
XML Generics
„
Course Logistics, Structure and Objectives
„
History of Meta-Markup Languages
„
XML Applications: Markup Languages
„
XML Information Modeling Applications
„
XML-Based Architectures
„
XML and Java
„
XML Development Tools (XML, DTD and Schema Editors)
„
Summary
„
Class Project
„
Readings
„
Assignment #1a
3
Old History
„
„
Formatting Markups
„
Rendition notations (e.g., LaTeX, TeX, RTF, MIF)
„
Compatible with standard text editors
„
Processed into presentations (printout, or electronic display)
WYSIWYG
„
„
What You See Is “ALL” You Get
Meta-Markup Language
„
GML (Goldfarb, Mosher, Lorie - IBM 1969)
„
Generalized (i.e., indep. of systems, devices, applications)
„
Markups (i.e., information related to struct. & content
„
Language (i.e., methodology with formal syntax)
„
Validation capabilities (1974)
4
2
SGML
„
SGML (1978 - 10/15/86)
„
Used by DoD for Continuous Acquisition and Lifecycle
Support (CALS)
„
http://www.oasis-open.org/cover/general.html
„ SGML DTD or Schema
<!DOCTYPE tutorials [
<!ELEMENT tutorials – (tutorial+)>
<!ELEMENT tutorial – (title, intro, chap+)>
<!ELEMENT title – O (#PCDATA)>
<!ELEMENT intro – O (para+)>
<!ELEMENT chap – O (title, para+)>
<!ELEMENT para – O (#PCDATA)>
5
]>
SGML Markup
<tutorials>
<tutorial>
<title>XML TUTORIAL
<intro>
<para>Required first paragraph of intro.
<para>Optional second paragraph of intro.
</intro>
<chap>
<title>CHAPTER 1
<para>Required first paragraph of first chapter.
<chap>
<title>CHAPTER 2
<para>Required first paragraph of optional 2nd chapter.
</tutorial
</tutorials>
6
3
W3C and HTML
„
„
Tim Berners-Lee (CERN, 1989)
„
W3 Hypertext System
„
W3 uses HTML
„
Founder of W3C in 1994
HTML
„
„
Based on SGML, no DTD support)
W3C
„
HTML (http://www.w3.org/TR/html401/)
„
CSS + weakly extensible HTML
„
XML
„
XHTML (http://www.w3.org/TR/xhtml1)
7
XML
„
„
DTD
<!DOCTYPE TUTORIALS [
<!ELEMENT tutorials (tutorial+)>
<!ELEMENT tutorial (title, intro, chap+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT intro (para+)>
<!ELEMENT chap (title, para+)>
<!ELEMENT para (#PCDATA)>
]>
XML is different from SGML
„
Names are case sensitive
„
Non empty elements must have a start and end tag
„
DTD or Schema not required
8
4
Current State of XML Standards
http://www.w3.org/XML, www.w3.org/XML/Activity.html, www.w3schools.com/xml
„
„
eXtensible Markup Language (XML) 1.0 (2nd Edition) - 10/06/00)
Namespaces in XML - 01/14/99
„
„
„
„
„
XML Schema Part 0: Primer - 05/02/01
XML Schema Part 1: Structures - 05/02/01
XML Schema Part 2: Datatypes - 05/02/01
XML Path Language (XPath) Version 1.0 - 11/16/99
„
„
Use “xml:stylesheet” element in the XML document prolog
XSL Transformations (XSLT) Version 1.0 - 11/16/99
„
„
Working Draft of Version 2 - 05/02/03
Associating Stylesheets with XML Documents - 06/29/99
„
„
URIs: http://www.w3.org/Addressing/
Working Draft of Version 2 -05/02/03
Extensible Stylesheet Language (XSL) Version 2.0 – 10/15/019
Current State of XML Standards
(continued)
„
„
Canonical XML Version 1.0 - 03/15/01
Document Object Model (DOM) Level 2 - 11/13/00
„
„
„
„
Web Content Accessibility Guidelines 1.0 - 05/05/99
Resource Description Framework (RDF) - 02/22/99
See http://www.w3.org/TR/ for Additional Specifications
„
„
Core, XSL, Query, Linking, Schema
Microsoft Validator:
„
„
Core, Views, Events, Style, Traversal & Range
http://msdn.microsoft.com/downloads/samples/Internet/xml/xml_validator/sample.asp
W3C Schema Validator (3/30/03)
„
http://www.w3.org/2001/03/webdata/xsv
10
5
Advanced Applications of XML
„
Ancestors: SGML with Annex K, HyTime, DSSS
„
Alternatives: HTML 4.01, CSS
„
HTML-Based
„
„
POP-Based
„
„
e.g., XHTML, CML, MathML, SMIL, SVG, P3P, RDF, WML
MOM-Based
„
„
XHTML 1.0, XForms 1.0
e.g., ebXML, RosettaNet, cXML, fpML, FIXML
Web Services-Based
„
Protocols (SOAP, WSDL, UDDI)
„
Services & Facilities (XAML – Transaction Authority ML)
11
Logical Structure of XML Documents:
Namespaces 1.0
• Namespaces: provides a simple method to qualify
element and attribute names used in XML documents
by associating them with namespaces identified by
URIs
– Example: <price> is borrowed from the “edi” schema
<?xml version=“1.0”?>
<order:x
xmlns:order=‘http://ecommerce.org/order’>
xmlns:edi=‘http://ecommerce.org/edi’>
<edi:price>14.95</edi:price>
</order:x>
• See http://www.w3.org/TR/REC-xml-names/
12
6
eXtensible Style Language (XSL)
„
„
“Descendant” of SGML’s DSSSL & DSSSL-O
CSS 1, 2, 3 …
„
„
„
„
„
XSLT (tree transformation)
XPath (accessing, pointing to, and matching)
XSL-FO (formatting objects)
XSLT Processors
„
„
„
„
http://www.w3.org/Style/CSS/
Stylus Studio XSL development environment
IBM XSL Editor
Saxon and Xalan XSLT processors
XSL-FO Processors
„
„
Antenna House
fop
13
XSL Processing
„
http://www.w3.org/Style/XSL/
„
Processing Alternatives:
„
„
„
„
„
Client or Server Processing ?
„
„
HTML + CSS -> Presentation
XML + CSS -> Presentation
XML + XSLT -> XSL-FO -> Presentation
XML + XSLT -> XML/HTML + CSS -> Presentation
See Session 2 handout on IE5+’s implementation
Examples
„
„
„
„
See Session 2 Sub-Topic 1 Presentation: Beginning XML
See Session 2 handouts on XSL Tree Transformation Language
See Session 2 handout on Cascading Stylesheets
See Session 2 handout on Styling Documents Using XSL
14
7
Character Encodings & Text Processing
„
ASCII, ISO 8859, and Unicode
„
„
„
„
„
http://www.bbsinc.com/iso8859.html
http://www.oasis-open.org/cover/unicode-xml.html
www.unicode.org
http://www.oasis-open.org/cover/unicode-xml.html
http://home.att.net/~jameskass
• Using Unicode characters in XML/HTML
„
– U+ (4 digit min) hex number (e.g., "U+1234”)
– Specify as: "&#x1234;" or "&#x10FFFD;".
White space processing ?! (wanted vs. unwanted)
15
XML & DBMSs Comparison
„
„
Both separate data from rendition/presentation info
Similar languages
„
„
„
No DML in XML
„
„
„
„
XML is paired with a scripting or programming language
Validation capabilities
„
„
DBMSs: Forms and Reporting, DDL, DQL, DCL
XML: XSL, XQL, and processing instructions
DBMSs: datatyping, relationship constraints
XML: data type validity and semantic consistency checks
XML can handle data too complex for some databases
XML interchangeable form of data vs. multidatabases
16
8
Course Approach ...
„
IBM XML Certification Test 140
„
„
„
„
IBM Certified Developer – XML and Related Technologies
http://www-4.ibm.com/software/ad/certify/obj140.html (old)
http://www-1.ibm.com/certify/tests/obj141.shtml (latest)
Proficiency Objectives
– Architecture Implications on XML Design
– Information Modeling
– XML Processing
– XML Rendering
– XML Query
– Implementation Testing and Tuning
17
XML Application Development
„
„
Applications of XML: Markup Languages
XML Applications Using Core XML Technologies
„ POP (Java is “optional”)
„
„
„
„
Web Content Programming
Web Application Development
Web-Enabled Enterprise Application Development
MOM
„
„
EDI v.s. IEC/B2B
EAI Applications
„
„
„
„
e.g., ERP, SCM, CRM integration
B2Bi, BPM, LE, and EII Applications
Application Configuration
Architectural Patterns requiring new XML protocols
„
SOAs, P2P, Grid Computing, Brick by Brick Computing, etc.
18
9
XML POP Application Development
Java “Independent” Component Models
„
JSP Custom Tags
XML/XSLT
XML/Servlet Frameworks (e.g., Cocoon)
XML/Servlet Filters
XML/JavaScript
XML Data Bindings
„
„
„
„
„
„
Java Intensive Component Models
„
JSP/Java
JSP/JavaBeans
Applets/Java Web Start
Servlets
Java Server Faces
Java Applications (Including Thick Clients)
„
„
„
„
„
„
19
XML MOM Application Development
„
Java “Independent” Component Models
„
„
„
Scripting Languages
Non J2EE Platforms (e.g., CORBA 3 & .Net) and PLs
Web Services Platforms
„
„
„
„
„
„
Sun Open Net Environment (ONE)
HP NetAction
Oracle Dynamic Services
IBM WebSphere Platform
Microsoft .NET
Java Intensive Component Models
„
„
„
„
„
EJBs
JSP/JavaBeans
Applets/Java Web Start
Servlets
Java Applications
20
10
XML References
„
„
Information
– www.learnthenet.com/english/index.html
– http://www.xml.com
– http://www.xml.org
– http://www.xmlu.com
– http://www.ucc.ie/xml
– http://www.oasis-open.org/cover
– http://msdn.microsoft.com/xml
– http://xml.about.com
Software
–
–
–
–
–
http://xml.apache.org
http://www.alphaworks.ibm.com/
http://www.microsoft.com/xml
http://technet.oracle.com/tech/xml
http://java.sun.com/xml
– http://www.xmlsoftware.com
– http://www.xmlcenter.com/tools/
21
Class Project
„
Project Description
„
The project will consist of providing custom XML-based services to
support the various aspects of your own selected portable application.
The application can be targeted to end-users (B2C), businesses (B2B),
developers (toolkit). As an example, you could implement and XMLbased training studio supporting VoiceXML, and application-sharing
capabilities.
„
Sample applications used in the past fell in the category of “multichannel online community platforms”, and included applications such
as “community-based shopping”. In that context, examples of useful
XML-based services to support these platforms may include
synchronized multimedia presentation viewing, and “offline” chat
capabilities. A sample specification of the online community platform
for a virtual university eBusiness application that was used in the past
for this course will be provided for illustration purpose.
22
11
Generic Architecture Blueprint
+ Architecture Design Methodology + Mgmt
XML Applications
(logic)
Logical View
Implementation View
Applications of XML
(structured content/object data, style information)
Use
Case
Use Case
View
View
XML Application Services
(logic)
XML Application Infrastructure
(logic)
Process View
Deployment View
Technology Infrastructure
(hardware platforms)
Management
Applications
of
XML
XML
Applications
Processing
Structure
Application
Rendering
Content
Querying
and
Technology
Infrastructure
Additional
Services
Style
23
Sample Conceptual Architecture Diagram
(e.g., virtual classroom environment)
Presentation Enabling
(posting, querying, locating, viewing)
Q&A Enabling
(questions capture, integration, viewing)
SMIL
Authoring
Tool
SMIL
XML
Authoring
Tool
XLF
XLF Processing/Rendering
JSP Engine / SMIL Viewer
(processing, rendering)
XML POP Framework
(processing, rendering)
Web Community Avatar-Based Chat Platform
Web-Based Infrastructure
(lightweight client machines, server platforms)
Legend
XML Application (logic )
3rd Party Tool
Applications of XML (content/style)
XML Application Infrastructure (logic)
XML Application Services (logic )
Technology Infrastructure (OS and hardware)
24
12
Structured Applications Design Tips
„
Reuse: should focus on Domain Models/System Family Architectures
„
Applications should separate the various information elements (i.e.,
content, logic, style, and architecture/handling schemes)
„
Various content formats: presentation, message, storage, etc.
„
Application architecture supports:
„
Web Enabling (WE), XML Enabling (XE), Data Enabling (DE), Enterprise
System Assurance Enabling (ESAE)
„
Various application support services to support:
„
Interactions with users via content (content + logic) - WE
„
Encoding of user requests as secure (portable) messages (content generation) XE/ESAE
„
Processing of user requests via logic (content + logic) - XE
„
Rendering of content via logic using style (content + style + logic) - WE/XE
„
Querying information via logic (content + logic) - XE/DE
„
Interactions with back office via content (content + logic) - XE/ESAE
25
Readings
„
„
Readings
„
XML and Java: Chapter 1, Appendices A, B, and C
„
Processing XML with Java: Chapter 1, Appendix C
„
Developing Java Web Services: Chapters 1 and 2
„
Handouts posted on the course web site
„
Review Xpath 1.0, XSLT 2.0, XSL 1.0 W3C Recs
Project Frameworks Setup (ongoing)
„
Apache’s Web Server, TomCat, and Cocoon
„
Apache’s Xerces, Xalan
26
13
Assignment
„
Assignment #1b:
„
Review the class project description, and the virtual
university sample eBusiness application specification
„
Come up with your own variant of an XML-based
portable application
„
Specify a set of services that would need to be provided to
support your portable application
27
Assignment (continued)
„
Assignment #1b (continued):
„
Provide a written specification of your overall framework (i.e.,
platform and services), and propose a staged development
approach that would demonstrate the use of XML to support
the modern approach at building comprehensive business
applications suggested in this course. Your proposed approach
should include the use of XML Markup Language
technologies, XML information modeling, XML information
processing, XML information rendering, XML information
retrieval, XML-Based frameworks and other services, and
XML application implementation and testing methodologies
and tools
28
14
Next Session:
XML Information Modeling (Part I)
„
„
„
„
XML Physical Entities
Logical Structure of XML Documents
XML Document Navigation
Custom Markup Languages
29
15