XML Technologies and Related Applications Lesson 1.

41
XML Technologies XML Technologies and Related Applicat and Related Applicat ions ions Lesson 1 Lesson 1

Transcript of XML Technologies and Related Applications Lesson 1.

Page 1: XML Technologies and Related Applications Lesson 1.

XML Technologies XML Technologies and Related Applicationsand Related Applications

Lesson 1Lesson 1

Page 2: XML Technologies and Related Applications Lesson 1.

XML related technologiesXML related technologies

XML,DTD,Schema, XSLT, DOM, PDOM, SAXML,DTD,Schema, XSLT, DOM, PDOM, SAX, XPATH, XQuery…..X, XPATH, XQuery…..

Web Service, RDF, WSDL, SOAP, SemantiWeb Service, RDF, WSDL, SOAP, Semantic Web, Grid, Ontology…..c Web, Grid, Ontology…..

XML Message, EAI…XML Message, EAI… CML, MathML, VoiceML, SVG, SMIL, DrML, CML, MathML, VoiceML, SVG, SMIL, DrML,

ebXML…ebXML…

Page 3: XML Technologies and Related Applications Lesson 1.

We’ll cover …We’ll cover …

XMLXMLDTDDTD

SchemaSchemaNamespaceNamespace

DOMDOMSAXSAX

XPathXPath

XQueryXQueryCSSCSSXSLXSL

XSLTXSLTXlinkXlink

XPointerXPointerXIncludeXInclude

SOAPSOAPBiztalkBiztalk

XML & encryption, signature, securitXML & encryption, signature, security y

XML & DatabasesXML & DatabasesXML & DOTNETXML & DOTNET

XML & JAVAXML & JAVA

Page 4: XML Technologies and Related Applications Lesson 1.

Reference BooksReference Books 《《 XMLXML 应用教程》吴洁 清华大学出版社应用教程》吴洁 清华大学出版社 《《 XML XML 数据库设计》 数据库设计》 Mark GravesMark Graves 机械工业出版社机械工业出版社 《《 XML XML 编程技术大全》编程技术大全》 H.M.Deitel H.M.Deitel 清华大学出版社清华大学出版社

Page 5: XML Technologies and Related Applications Lesson 1.

Other reference materials(1)Other reference materials(1)

www.w3c.org (www.w3.org)www.w3c.org (www.w3.org) www.xml.comwww.xml.com www.xml.orgwww.xml.org www.oasis-open.org www.oasis-open.org xml.coverpages.org/xml.htmlxml.coverpages.org/xml.html bbs.xml.org.cnbbs.xml.org.cn ……

Page 6: XML Technologies and Related Applications Lesson 1.

Other reference materials(2)Other reference materials(2)

1.W3C---XML Basics1.W3C---XML Basics2.IBM Developerworks, MS MSDN, Apache 2.IBM Developerworks, MS MSDN, Apache

XML.XML.3.ACM SIGMOD, VLDB, DBLP3.ACM SIGMOD, VLDB, DBLP4.BOOKS4.BOOKS

Data on the web. Weaving the web, xml Data on the web. Weaving the web, xml bible, database system implementationbible, database system implementation

Page 7: XML Technologies and Related Applications Lesson 1.

Overview of XML

Objectives : Learn about the history of XML. Understand how XML is used in business. Compare XML with other data formats. Learn about the ten design goals of XML.

Page 8: XML Technologies and Related Applications Lesson 1.

One Simple ExampleOne Simple Example<?xml version="1.0" encoding="UTF-8"?><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE BookStore SYSTEM "F:\book.dtd"><!DOCTYPE BookStore SYSTEM "F:\book.dtd"><BookStore><BookStore>

<Book><Book><Title><Title>data on the web</Title>data on the web</Title><Author><Author>serge abiteboul</Author>serge abiteboul</Author><Date><Date>july 2000</Date>july 2000</Date><ISBN>1-55860-23</ISBN><ISBN>1-55860-23</ISBN><Publisher><Publisher>morgan kaufmann publishers</Publisher>morgan kaufmann publishers</Publisher>

</Book></Book></BookStore></BookStore>

Page 9: XML Technologies and Related Applications Lesson 1.

History of Markup LanguageHistory of Markup Language

Data: Proprietary Format (manufacturer, platform)Data: Proprietary Format (manufacturer, platform) Standard Generalized Markup Language (SGML) faStandard Generalized Markup Language (SGML) fa

milymily Hypertext Markup Language (Hypertext Markup Language (HTMLHTML)) Dynamic Hypertext Markup Language (DHTML)Dynamic Hypertext Markup Language (DHTML) eXtensible Hypertext Markup Language (XHTML) eXtensible Hypertext Markup Language (XHTML) eXtensible Markup Language (eXtensible Markup Language (XMLXML))

Q: Why do we need new markup languages if HTML is Q: Why do we need new markup languages if HTML is so successful? And what is XML?so successful? And what is XML?

Page 10: XML Technologies and Related Applications Lesson 1.

HTML and XML (1)HTML and XML (1) Both have their origins in SGML. Both are simplificatio

ns and specializations of SGML to solve specific problems.

HTML and XML are tools existing to help in document creation, the underlying premise is the same: Mix content with structure. In HTML the structure is primarily related to layout and prese

ntation. In XML the structure is primarily about metadata (data about

data) and relationships between data elements.

Page 11: XML Technologies and Related Applications Lesson 1.

HTML and XML (2)HTML and XML (2) XML is not a replacement for HTML, but a part

ner to provide enhanced communications. Advanced applications of SGML ignore the for

mat of text, but include something much more important, the context of the text or data.

Cf. HTML is about layout and presentation, while XML is about structure and data.

Page 12: XML Technologies and Related Applications Lesson 1.

HTML and XML (3)HTML and XML (3)

HTMLHTML XMLXML HTML tags are defined by a staHTML tags are defined by a standards body.ndards body. Imposed on designers and devImposed on designers and developers.elopers. Tags used in HTML are clearly dTags used in HTML are clearly defined.efined.

Defined to avoid standardizing.Defined to avoid standardizing. Developer has complete freedoDeveloper has complete freedom in tags chosen in an XML docum in tags chosen in an XML document.ment.

The “X” in XML stands for extensibility. You define XML—it doesn’t define you.

Page 13: XML Technologies and Related Applications Lesson 1.

HTML and XML (4)HTML and XML (4)AdvantagesAdvantages DisadvantagesDisadvantages

HTMHTMLL

Consistent design model among all implementations.Inexpensive browsers implemented on a variety of platforms.Inexpensive document creation tools.

Must work around limitations when encountered.Difficult to keep up with the pace of change.Impossible to customize to fit special needs.

XMLXML Freedom to create documents that exactly meet your needs.Able to change as rapidly as your requirements change.Flexible and adaptable for use in integration projects.

Total freedom means limited or nonexistent tool support for working with other people’s documents.Programming effort nearly always required to accomplish anything.

Page 14: XML Technologies and Related Applications Lesson 1.

XML and Extensibility

There are no existing tags! Everything is 100% your decision! Data Type Definitions (DTD), XML Sche

mas, namespaces, and standards organizations are mechanisms by which the wilds of XML are tamed and made safe for business solutions.

Page 15: XML Technologies and Related Applications Lesson 1.

Unstructured Data and XML(1)

XML is to unstructured data, as relational database theory is to structured data.

RDMBS brought us: A mechanism to describe databases, tables,

rows, columns, and data types. A standardized way to query databases and

return data with this descriptive model. Strict rules governing the conduct of the dat

abase and its operation.

Page 16: XML Technologies and Related Applications Lesson 1.

Unstructured Data and XML(2)

There’s more unstructured data than structured data. word-processing documents, e-mail messages, spr

eadsheets, and so on Businesses need RDBMS-like features applied

to unstructured data(XML+DTD). In addition, XML can create a format that diffe

rent applications can read and write without losing any information.

Page 17: XML Technologies and Related Applications Lesson 1.

XML Is Perfect for Non-Tabular Data

Not in rows and columns of tables. Loosely structured lists and complex int

errelationships between elements XML will impact the collection of such no

n-tabular data, and because of that processing and distribution of the data will be easier and more efficient.

Page 18: XML Technologies and Related Applications Lesson 1.

The Independence of XML XML is independent of:

• Vendor or author• Operating system• Source application• Destination application• Storage medium• Transmission protocolTo be truly independent of everything makes it diffic

ult to provide an implementation on a specific platform.

Page 19: XML Technologies and Related Applications Lesson 1.

XML Definition(1)

XML is a markup language for documents containing structured information. XML is about moving all forms of data and its meaning from many types of source to any kind of destination.

<salary specie=”yuan”>3000</salary>

Page 20: XML Technologies and Related Applications Lesson 1.

XML Definition(2)

Eventually more and more data will be stored natively as XML, making XML text a common source rather than being seen strictly as a data migration and distribution medium.

Page 21: XML Technologies and Related Applications Lesson 1.

Actual values of XMLActual values of XML

Widespread implementation of XML solutions will yield:• Better access to more data, lower transacti

on costs and cleaner application integration. Underlying benefits:Underlying benefits:

• free, well supported, language-neutral, easily transported

Page 22: XML Technologies and Related Applications Lesson 1.

XML in the Real World Some of the XML document type standards alr

eady present and in use:• Open Financial Exchange (OFX)• Human Resources Markup Language (HRML)• Electronic Business XML (ebXML)• Voice Markup Language (VoxML)• Open Software Description (OSD)• Music Markup Language (MML)• SVG, MathML (Design Science Inc. (Design Science Inc. MathPlayerMathPlayer IBM IBM techexplorertechexplorer ) )

Page 23: XML Technologies and Related Applications Lesson 1.

MathMLMathML

д×Ö°åÎĵµ

Page 24: XML Technologies and Related Applications Lesson 1.

XML Frameworks

http://www.xml.com/business/http://www.xml.com/business/ Analysis of business issues in XML: management, plAnalysis of business issues in XML: management, pl

anning, industry initiatives and consortia.anning, industry initiatives and consortia.

Page 25: XML Technologies and Related Applications Lesson 1.

EDI vs. XML EDI stands for Electronic Data Interchange and has b

een in use for many years as a mechanism for communication between dissimilar database systems and applications. EDI has always been intended as a business-to-business com

merce solution. EDI solves many of the same problems as XML, but does it in v

ery different ways. XML and EDI have a lot in common.

EDI works well for its intended purpose, but it is complex and expensive to implement and maintain.

XML, however, has a wider scope beyond just financial data and the potential for much broader application in businesses of all sizes.

Page 26: XML Technologies and Related Applications Lesson 1.

Sth. About XML Document

Create the Document

Store and Retrieve

Display or Interpret

Page 27: XML Technologies and Related Applications Lesson 1.

Different Data views Documents: Its strength is in flexibility and ad

aptability. Its weaknessis inefficiency and lack of predictable structure.

Related Tables: Its strength is in data integrity and the efficiency of data access and modification. Its weakness is the rigidity of the required tabular structure.

Objects: Its strength is a combination of processing logic and dynamic flexibility. Its weakness is its complexity and lack of persistence and portability.

Page 28: XML Technologies and Related Applications Lesson 1.

Data in XML formatsData in XML formatsAdvantages Can be read by both machines and peop

le alike. It’s not trivial for people or computers,

but it’s not particularly challenging either.

Because data and meaning is encoded together, this document can be used for other purposes.

Disadvantages

Encoding is required. Applications need to be Applications need to be upgraded to sup

port XML.

Page 29: XML Technologies and Related Applications Lesson 1.

XML’s 10 Design Goals (1)

1. XML shall be straightforwardly usable over the Internet.

2. XML shall support a wide variety of applications.

3. XML shall be compatible with SGML.4. It shall be easy to write programs that process

XML documents.5. The number of optional features in XML is to be

kept to the absolute minimum, ideally zero.Tim Bray(one of the three editors of the XML specification)

Page 30: XML Technologies and Related Applications Lesson 1.

XML’s 10 Design Goals (2)

6. XML documents should be human-legible and reasonably clear.

7. The XML design should be prepared quickly.8. The design of XML shall be formal and concise.9. XML documents shall be easy to create.10. Terseness in XML markup is of minimal impor

tance.

Tim Bray(one of the three editors of the XML specification)

Page 31: XML Technologies and Related Applications Lesson 1.

XML Programming InterfacesXML Programming Interfaces Core SAX, DOM(W3C Standard model)Core SAX, DOM(W3C Standard model) Microsoft XML Parser (MSXML) Microsoft XML Parser (MSXML) Java : Java :

JDOM (Java DOM)JDOM (Java DOM) JAXP (Java API for XML)JAXP (Java API for XML) TrAX (Transformation API for XML)TrAX (Transformation API for XML) JAXB (Java Architecture for XML Binding )JAXB (Java Architecture for XML Binding ) XML4J (XML for Java) XML4J (XML for Java) …………

Page 32: XML Technologies and Related Applications Lesson 1.

XML Developing toolsXML Developing tools

Notepad + IE (NS)Notepad + IE (NS) Altova XMLSPY2006Altova XMLSPY2006 Stylus Studio XML Enterprise Edition 6 Stylus Studio XML Enterprise Edition 6 XMLwriter XML Editor 2.6XMLwriter XML Editor 2.6 oXygen XML Editor, Schema Editor and XoXygen XML Editor, Schema Editor and X

SLT Debugger 6.2SLT Debugger 6.2 xmlBlueprint XML Editor 3.8xmlBlueprint XML Editor 3.8

Page 33: XML Technologies and Related Applications Lesson 1.

Summary XML is not a replacement for HTML and, in fact, makes HTML morepowerful than before. XML is about moving data and its meaning from many types of sources to any kind of destination. Businesses can use XML to get better access to data, lower transaction costs, and cleaner application integration. Because of the freedoms allowed in XML, many implementations and frameworks have already been developed and many more are on their way. Without the strict adherence to the ten goals of XML, XML could never have soared to the top in popularity as it has done.

Page 34: XML Technologies and Related Applications Lesson 1.
Page 35: XML Technologies and Related Applications Lesson 1.
Page 36: XML Technologies and Related Applications Lesson 1.

XML Query LanguagesXML Query Languages

XQL, XML-QL, YATL, LOREL, XSQL, UnQL, SXQL, XML-QL, YATL, LOREL, XSQL, UnQL, StruQL , Quilt truQL , Quilt

Page 37: XML Technologies and Related Applications Lesson 1.

Creation of XML Documents

Potential sources of XML documents: The result of a conversion process

Email, spreadsheet, databases, web pages The result set of a traditional database query A function or remote procedure call (RPC) ret

urns an XML string instead of a more traditional return value.

The output of routine applications

Page 38: XML Technologies and Related Applications Lesson 1.

Store and Retrieve XML DOCs

Just simple textual information.Just simple textual information. Potential places to store XML documents inclu

de: Text files. In traditional RDBMS database tables. Keep it in memory and never store it anywhere. Store it in object-oriented databases (OODBMS). Store it in NXD databases (Native XML Databases). Other XML specific depository.

Retrieve and transport(http,smtp,ftp,ssl,etc.).Retrieve and transport(http,smtp,ftp,ssl,etc.).

Page 39: XML Technologies and Related Applications Lesson 1.

Display or Interpret XML DOCs

XML is not intended to be viewed or rendered by a specific tool.

Potential things to do with XML documents include: Apply a style sheet and display the result in a brows

er. Apply a document type definition or XML Schema. Examine the documents in your own applications.

Page 40: XML Technologies and Related Applications Lesson 1.

An XSL FileAn XSL File<?xml version=“1.0”,encoding=“UTF-8” ?><xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

<xsl:template match="/"><html>

<xsl:apply-templates/></html>

</xsl:template><xsl:template match=“bookstore">

<xsl:apply-templates/></xsl:template><xsl:template match=“book">

<P><xsl:value-of select="."/>

</P></xsl:template>

</xsl:stylesheet>

Page 41: XML Technologies and Related Applications Lesson 1.

CSS & XSLCSS & XSL

CSSCSS XSLXSLCan be used with HTML?Can be used with HTML? yesyes nonoCan be used with XML?Can be used with XML? yesyes yesyesTransformation language? noTransformation language? no yes yesSyntaxSyntax CSSCSS XMLXML