SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 1
XML:Another Markup Language or
Internet Revolution ?
Dr. Wei-Guo Peng
SAP AG
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 2
Table of Content
Part 1: XML for managers� What is XML?
� Why is XML so hot?
� XML applications and tools
Part 2: XML for programmers� XML and XSLT syntax
� SAX and DOM
� XML programming model
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 3
A Little History of Information Technology
OfficeAutomation
EnterpriseAutomation
Inter-EnterpriseAutomation
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 4
Part One
Part 1: XML for managers� What is XML?
� Why is XML so hot?
� XML applications and tools
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 5
XML: W3C Definition
The Extensible Markup Language (XML) is asubset of SGML that is completelydescribed in this document. Its goal is toenable generic SGML to be served,received, and processed on the Web in theway that is now possible with HTML. XMLhas been designed for ease ofimplementation and for interoperability withboth SGML and HTML.
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 6
XML: What others say (1)
� Utzschneider - Microsoft„It's not a question of whether or not you're going toneed XML -- you're going to choose to use XML in thesame way companies five years ago chose to use HTMLand HTTP. Companies weren't dragged kicking andscreaming to use browsers. They chose to usebrowsers.“
� Phip Costa - Giga Infomation Group"It's becoming pretty clear that XML is going to be awidely deployed technology,"
� Mark Driver - Gartner Group„XML is not a product or a platform. Neither is it thesecond coming of Java, nor a latter-day SQL. It is anenabling technology, like IP itself.“
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 7
XML: What others say (2)
� Frank Gillett - Forrester Research„XML has only just reached the point where it is startingto ramp up big.“
� Lamoureux:„XML is just too compelling to ignore. „
� Microsoft:„The key enabler for Microsoft's vision of integrated,programmable Web services is XML.“
� Doug Tidwell - IBM„A technical revolution comparable in scope to slicedbread and the wheel.“
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 8
Future SAP Application Programming
App. Server
App. Server
App. Server
MessageBroker SAP
App Server
Presentation Server
HTTP + XML
HTTP + XML
ApplicationBackbone/Fulfillment Engine
Browser Clients(form caching, data chunking)
HTTP + HTML + XML
� Presentation open forcustomer adaptation
� Application flow open forcustomer adaptation
Presentation server benefits:
InternetValue Network
Internet/Intranet
ExistingSAP clients
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 9
The Internet Revolutions
TCP/IPUniversal Connectivity
XMLUniversal Data
HTMLUniversal Rendering
HTTPUniversal Transport
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 10
The First Internet Revolution
<p><b>Mrs. Mary McGoon</b> <br/> 1401 Main Street <br/> Anytown, NC 34829
</p>
Markup
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 11
What is HTML
� HTML is a markup language
� Fixed tag semantics
� Industrial standard - in version 3.2, 4.0
� Netscape Navigator 4.0 / Internet Explorer 5.0
� DHTML� interactive
� browser independent
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 12
HTML Demo
Demo
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 13
What is XML
<address country=„us“><name>
<title>Mrs. </title><first-name>Mary</first-name><last-name>McGoon</last-name>
</name><street>1401 Main Street</street><city>Anytown</city><state>NC</state><zipcode>34829</zipcode>
</address>
Tag
MarkupContent
Attribute
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 14
XML Components
� Data / Document� XML
� Type Information (meta data)� DTD/Schema
� In-Memory Programming Model� DOM
� Style and Transformation� XSL (XSLT)
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 15
XML: Markups
� Character data (Unicode)
� Element
� Entity reference
� Comment
� Processing instruction
� Document type declararion
� CDATA section
XML documents contain:
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 16
DTD: Document Type Language
<!ELEMENT address (name, street, city, state,zipcode)*>
<!ELEMENT name (title, first-name, last-name)>
<!ELEMENT title (#PCDATA)><!ELEMENT first-name (#PCDATA)><!ELEMENT last-name (#PCDATA)><!ELEMENT street (#PCDATA)><!ELEMENT city (#PCDATA)><!ELEMENT state (#PCDATA)><!ELEMENT zipcode (#PCDATA)><!ATTLIST addresscountry CDATA #IMPLIED
>
<!ELEMENT>
<!ATTLIST>
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 17
DTD and Schema
•DTD•is included in XML 1.0•its own syntax•document-oriented data types
•Schema•not yet a standard•XML syntax•data-oriented data types•enables reuse•supports namespace
•Use DTD instead of Schema
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 18
XML: Well-formed vs. Valid Documents
� Well-formed� Valid syntax
� No mulitvalued attributes
� Non-empty tags must be properly nested
� Parameter entities must be declared before they are used� All entities except the following: amp, lt, gt, apos, andquot must be declared
� A binary entity is reference as entity
� no recursive entities are allowed
� Valid� Contains DTD
� Obeys the constraints defined in DTD
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 19
XSL - eXtensible Stylesheet Language
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"><xsl:template match="/"><HTML><p>
<b><xsl:value-of select="address/name/title"/><xsl:value-of select="address/name/first-name"/><xsl:value-of select="address/name/last-name"/>
</b><br/><xsl:value-of select="address/street"/><br/><xsl:value-of select="address/city"/>,<xsl:value-of select="address/state"/><xsl:value-of select="/address/zipcode"/>
</p></HTML></xsl:template></xsl:stylesheet>
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 20
XSLT: XSL Transformation
� Translate one XML language to another� Mapping between industries
� XML -> HTML
� Filter XML� Fetch the needed data
� Generate new data
� Declarative� Simple
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 21
Why XML?
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 22
XML Demo
Demo
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 23
XML: Markups
� Character data (Unicode)
� Element
� Entity reference
� Comment
� Processing instruction
� Document type declararion
� CDATA section
XML documents contain:
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 24
Features of XML
� Simple
� Human readable - Text format
� Industrial standard - vendor indepenent
� User extensible
� Structed document / Structured data
� Semantic Web - Web automation
� Metadata
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 25
Separation of data from its representation (1)
� Same content, different user agent
XML html
wml
mp3
html
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 26
Separation of data from its representation (2)
� Model, content, and layout belong to different user roles
XMLDTD Stylesheet
Editing Authoring Designing
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 27
Platform and Application Independent
� Everything is text
� No special editor is needed
� Every applications can read or write their data in XML
XML
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 28
Valuable metadata
� Metadata is expressed with:� DTD / XMLSchema� Tag name� Attribute� Datatype
� Can be used to validate XML data
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 29
Extensibility
� Free definable tags
� Self defined structure – schema
� Newly added elements won´t break the old application
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 30
Self-describing and Portable
� Self-describing� text format
� tags tell the meaning
� DTD as documentation
� Portable� standard format
� parser is widely available
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 31
Maintainability
� Flexible� tag oriented not line oriented
� Backward compatible� new tags
� new attribute
� Program at a higher level� less to code
� standard parser and DOM
� Easy debugging� text format
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 32
Internationalization
� UNICODE� www.unicode.org
� UTF-8
� UTF-16
� User defined character set� GB
� BIG5
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 33
Basic XML Tools
� XML Editor� XMetal, Adept Editor, FrameMaker, Notepad, vi
� XML Parser / Generator (DOM / SAX)� MSXML, X4J, expat
� XSL Processor� MSXSL
� XML Browser� IE5.0
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 34
Related Standards
XSL
XLink
WML
XPath
DOM
MathML
SMIL XSchema
RDF
CDF
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 35
3-tier Architecture: Web Enabling
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 36
Application Areas (1)
XMLUniversal Data
XML-RFCSOAP
eBusiness
ConfigurationPersonalization
DocumentManagement
Publishing
ApplicationIntegration
BusinessPortal
Inter-Application
Data Exchange
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 37
Application Areas (2)
XMLStructured Data
DatabaseIntegration
StructureSearch
ObjectPersistency
TechnicalDocument
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 38
Is XML a silver bullet?
� Standard syntax != standard semantic� domain-specific XML: bizTalk, finXML, OASIS� transformation (XSLT)
� A lot of standards are confusing� Document oriented, not yet data oriented
� data type� constraints
� DTD is not standardized� SML (Simplified XML)
� No attributes, PI, DTD, non-char entity ref, no CDATA� Only UTF-8
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 39
Summary
� XML will not replace HTML at least not NOW
� XML is a language for data
� HTML is a language for rendering
� XSLT is the language for transformation
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 40
Part Two
Part 2: XML for programmers� XML and XSLT syntax
� SAX and DOM
� XML tools
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 41
XML: Interesting Links and Meetings
� www.xml.com - Anotated XML 1.0� www.oasis-open.org/cover� www.w3.org� msdn.microsoft.com/xml� xdev.datachannel.com
� comp.text.xml� microsoft.public.xml
� XML Europe� XML World� XML One
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 42
Two standards groups
� IETF - Internet Engineering Task Forcewww.ietf.org
� W3C - World Wide Web Consortiumwww.w3.org
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 43
XML Big Players
� MicrosoftMSXML, bizTalk, SQL server exports XML
� Ariba - OMR
� CommerceOne
� Vignette
� webMethods
� Abortext
� Adobe
� SoftQuad
� Chrystal
� Waltham
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 44
Document Type Definition (DTD)
� Specifies the content model� valid element names (tags)
� valid attribute names and values
� how elements can nest in each other(number/sequence)
� Used to validate a document
� Typically DTD is stored in a separated file
� As documentation
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 45
DTD Element Declarations
� Specifies tree-like structure
� Uses regular expressions to define valid content
� Example:� <!ELEMENT el EMPTY>
� <!ELEMENT el ANY>
� <!ELEMENT mail (subject, from, to?, text)* >
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 46
DTD Attribute List Declarations
� Defines allowed attribute names and values of an element
� No multivalued attributes
� Limited data type - all are strings
� Example:� <!ATTLIST el
id ID #IMPLIEDname CDATA #REQUIREDtype (str|int|bool|float) „str“
>
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 47
DTD Attribute Types
� CDATA - Any value
� ID - must be unique in the whole document
� IDREF - Reference to an element with a specific ID
� Example:� <!ATTLIST el
id ID #IMPLIEDname CDATA #REQUIREDtype (str|int|bool|float) „str“
>
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 48
XML: DOM (Document Object Model)
� Standard programmatic access of XML/HTML� Defined at the API level (interface instead of
implementation)� Programming language independent� Current version - level two� Navigation of tree like structure� Requires a lot of memory� Basic element is „Node“
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 49
XML: SAX - Simple API for XML
� Event-driven� define event handler (startElement(), endElement())
� register event handler in an XML parser
� Simple
� Less memory consumption
� No tree structure
� No navigation
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 50
Namespace
� Avoid name conflict
� Example
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 51
Which Stylesheet to use?
� W3C recommendation:Use CSS when you can, use XSL when you must.
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 52
Example: Wireless Application Protocol (1)
� WAP creates the mobile internet. Access interneteverywhere
� WAP is a standard support by Nokia, Ericsson,Motorola, Phone.com
� Build-in billing mechanism. Credit card not needed
� 3 times more cell phone users than internet users
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 53
Example: Wireless Application Protocol (2)
SAP AG 1999 Knowledge Warehouse - XML (Dr. Wei-Guo Peng) / 54
Example: Wireless Application Protocol (3)
� WML
� WMLScript
� WBMP
Top Related