an introduction to xml joint presentation to the cdpug and gcpcug web publishing sig - august 26,...

54
An Introduction An Introduction to XML to XML Joint Presentation to the Joint Presentation to the CDPUG and GCPCUG Web Publishing CDPUG and GCPCUG Web Publishing SIG - SIG - August 26, 2004 August 26, 2004

Upload: trinity-mcconnell

Post on 27-Mar-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

An IntroductionAn Introductionto XMLto XML

Joint Presentation to theJoint Presentation to the

CDPUG and GCPCUG Web Publishing SIG CDPUG and GCPCUG Web Publishing SIG --

August 26, 2004August 26, 2004

Page 2: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Presentation OverviewPresentation Overview

What is XML?What is XML? Uses of XMLUses of XML XML in relation to other languagesXML in relation to other languages Learning basic XMLLearning basic XML Publishing with XMLPublishing with XML XML and databasesXML and databases XML ResourcesXML Resources

Page 3: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

What is XML?What is XML?

Extensible Markup Language - born Extensible Markup Language - born 2/19982/1998

Extensible - create new markup Extensible - create new markup languageslanguages

More than HTML, less than SGMLMore than HTML, less than SGML XML family of specificationsXML family of specifications

– XML, XSL, XSLT, XSL-FO, DOM, XML XML, XSL, XSLT, XSL-FO, DOM, XML Namespaces, XLink, XPointer, XPath, XML Namespaces, XLink, XPointer, XPath, XML Schema, XML Query LanguageSchema, XML Query Language

Page 4: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XMLUses of XML

Data StorageData Storage Data InterchangeData Interchange Data Display/Rendering/PublishingData Display/Rendering/Publishing

All of the above are interrelatedAll of the above are interrelated All of the above are about All of the above are about datadata

Page 5: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XMLUses of XML Some specific examplesSome specific examples

– United Way I&R data interchange (call 211)United Way I&R data interchange (call 211)– Dreamweaver extensionsDreamweaver extensions– File management of digital photographsFile management of digital photographs– Transmit information from handheld into Transmit information from handheld into

database (e.g., U-Haul)database (e.g., U-Haul)– CSU data transformation POC modelCSU data transformation POC model

Excel Excel Access Access XML, XSL XML, XSL

– Burden shifting: database server Burden shifting: database server web web serverserver

Limited only by your imagination (?)Limited only by your imagination (?)

Page 6: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - Data StorageUses of XML - Data Storage

Data StorageData Storage– Products marketed as “XML databases”Products marketed as “XML databases”

TaminoTamino TEXTMLTEXTML

– XML-enabled databasesXML-enabled databases Oracle, SQL Server, DB2Oracle, SQL Server, DB2

note: this is not a product endorsement

Page 7: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - Data StorageUses of XML - Data Storage

When is XML Suited for Data Storage?When is XML Suited for Data Storage?– Data needs to be accessed by many Data needs to be accessed by many

systemssystems– Hierarchical dataHierarchical data– Smaller data set *Smaller data set *– Speed not criticalSpeed not critical– Simpler queries used *Simpler queries used *– Data must be stored for a long timeData must be stored for a long time

* Becoming less important over time as a consideration

Page 8: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - Data Uses of XML - Data InterchangeInterchange

Application

Application Application

Application Application

Application Application

Application

Many translators (bridges) vs. a common language

XML

Page 9: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - Uses of XML - Display/RenderingDisplay/Rendering

Data Display/RenderingData Display/Rendering– Present the same content differently for Present the same content differently for

different devicesdifferent devices

Before XML . . .Before XML . . .– Either support older standard only (e.g., Either support older standard only (e.g.,

HTML 3.2)HTML 3.2)– Or develop multiple sets of pages and Or develop multiple sets of pages and

redirect user based on their browserredirect user based on their browser

Page 10: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - Uses of XML - Display/RenderingDisplay/Rendering

With XML . . .With XML . . .– One set of XML documentsOne set of XML documents– One XSL document for each One XSL document for each

browser/devicebrowser/device– If a new device or new use for existing If a new device or new use for existing

device emerges…device emerges… develop new standard protocol (e.g., WAP)develop new standard protocol (e.g., WAP) develop another XSL documentdevelop another XSL document

Page 11: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - Uses of XML - Display/RenderingDisplay/Rendering

Then eitherThen either– serve XML and XSL to clientserve XML and XSL to client

OrOr– transform XML with XSL at servertransform XML with XSL at server– serve appropriate markup to clientserve appropriate markup to client

Page 12: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - PublishingUses of XML - Publishing

XMetaLDocumentum

Platform

Repurposing of content

HTML

note: this is not a product endorsement

content authoring

tool

content storage

management

PDF

MS Word

content

WAP

Page 13: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - PublishingUses of XML - Publishing

In 2002, the USAF AWACS technical documentation was converted to XML

Photo from http://www.nato.int

Page 14: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Uses of XML - burden shiftingUses of XML - burden shifting

clientweb server database server

clientweb server database server

XML

Reduce the burden on a database server

Page 15: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Why is XML needed?Why is XML needed?

Consider HTMLConsider HTML

– HyperText Markup LanguageHyperText Markup Language

– Based on SGMLBased on SGML

– Most web pages use HTMLMost web pages use HTML

Page 16: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Why is XML needed?Why is XML needed?

Advantages of HTMLAdvantages of HTML– Easy to learn compared to most Easy to learn compared to most

programming languagesprogramming languages Readily available authoring tools (even a Readily available authoring tools (even a

text file editor)text file editor) Readily available rendering toolReadily available rendering tool

Browsers are free, all new PCs have browsers Browsers are free, all new PCs have browsers installedinstalled

Page 17: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Why is XML needed?Why is XML needed?

Disadvantages of HTMLDisadvantages of HTML– Deviation from its original purpose Deviation from its original purpose

Presentation should be based on a styling Presentation should be based on a styling languagelanguage

– Lack of extensibilityLack of extensibility– Toleration of faulty codeToleration of faulty code

acceptable for web page designacceptable for web page design unacceptable for transmission of dataunacceptable for transmission of data

Page 18: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Why is XML needed?Why is XML needed?

Consider SGMLConsider SGML

– Standard Generalized Markup LanguageStandard Generalized Markup Language No toleration of faulty codeNo toleration of faulty code Completely extensibleCompletely extensible

– HTML, XML based on SGMLHTML, XML based on SGML

Page 19: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Why is XML needed?Why is XML needed?

The advantages of SGML are actually The advantages of SGML are actually disadvantages in the web environmentdisadvantages in the web environment

Complete extensibility of SGML meansComplete extensibility of SGML means– It is not cost-effective to develop browsers It is not cost-effective to develop browsers

to support SGMLto support SGML– Potentially huge bandwidth and storage Potentially huge bandwidth and storage

issuesissues

Page 20: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Why is XML needed?Why is XML needed?

XML allows the use of metadata - “data XML allows the use of metadata - “data about data”about data”

HTML tagsHTML tags– <p>The Gettysburg Address was written <p>The Gettysburg Address was written

by Abraham Lincoln</p>by Abraham Lincoln</p> XML elementsXML elements

– <document>The Gettysburg Address <document>The Gettysburg Address </document> was written by </document> was written by <president><author>Abraham <president><author>Abraham Lincoln</author></president>Lincoln</author></president>

Page 21: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

SGML, XML, HTMLSGML, XML, HTML

XML and HTML are subsets of SGML XHTML is HTML rewritten as an XML-based language

SGML

HTMLXML

XHTML

Page 22: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML-based languagesXML-based languages

XML extensibility has led toXML extensibility has led to– Extensible Business Reporting Language (XBRL) Extensible Business Reporting Language (XBRL) – Security Assertion Markup Language (SAML)Security Assertion Markup Language (SAML)– Predictive Model Markup Language (PMML)Predictive Model Markup Language (PMML)– CellMLCellML

““to store and exchange computer-based biological models.”to store and exchange computer-based biological models.”

– HR-XML consortiumHR-XML consortium ““. . . an independent, non-profit organization dedicated to the . . . an independent, non-profit organization dedicated to the

development and promotion of a standard suite of XML development and promotion of a standard suite of XML specifications to enable e-business and the automation of specifications to enable e-business and the automation of human resources-related data exchanges.”human resources-related data exchanges.”

– Many othersMany others

Page 23: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Basic XMLBasic XML

<?xml version="1.0"?><CONTACTS> <DATABASE USERTYPE="PERSONAL">Contact List</DATABASE> <ENTRY NUMBER="1"> <NAME> <LAST_NAME>Sanford</LAST_NAME> <FIRST_NAME>Bill</FIRST_NAME> </NAME> <TITLE>VP, Controller</TITLE> <COMPANY>SDC, Inc.</COMPANY> <WEBSITE>www.sdcinc.biz</WEBSITE> <ADDRESS>4132 Homestead Rd.</ADDRESS> <CITY>Parma</CITY> <STATE>OH</STATE> <ZIP>44134</ZIP> <PHONE> <DIRECT>440-398-2098</DIRECT> <CELLULAR>440-123-4567</CELLULAR> </PHONE> <EMAIL>[email protected]</EMAIL> </ENTRY></CONTACTS>

XML Markup includes:

• XML declaration

• Root Element

• Elements

• Attributes

• Entities

Page 24: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XHTMLXHTML

Next-generation of HTMLNext-generation of HTML HTML specification rewritten to be XML HTML specification rewritten to be XML

compliantcompliant XML is XML is notnot going to replace HTML, XHTML going to replace HTML, XHTML

isis Differences between HTML, XHTML Differences between HTML, XHTML

include:include:– lower case tags requiredlower case tags required– proper nesting and closure of tagsproper nesting and closure of tags– quoting attributesquoting attributes

Page 25: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

ParsersParsers

A parser is a program that processes A parser is a program that processes an XML document. an XML document.

IE includes a parser that allows the IE includes a parser that allows the rendering of XML documents. rendering of XML documents.

Parsers are either validating or non-Parsers are either validating or non-validating. validating.

Page 26: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Well-formednessWell-formedness

An XML document is An XML document is well-formedwell-formed if if– attribute values are in quotesattribute values are in quotes– tags are properly nestedtags are properly nested– start and end tags are the same casestart and end tags are the same case– there is one root elementthere is one root element– empty elements must be formatted empty elements must be formatted

properlyproperly

If it’s not well-formed, it’s not XMLIf it’s not well-formed, it’s not XML

Page 27: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Document Type Definition Document Type Definition (DTD)(DTD)

Used to specify how elements, Used to specify how elements, attributes, etc. relate to each otherattributes, etc. relate to each other

DTDs are DTDs are notnot XML documents, but are XML documents, but are used by themused by them

DTDs do not support data typingDTDs do not support data typing XML Schema was developed in part to XML Schema was developed in part to

address lack of data typing in DTDsaddress lack of data typing in DTDs XML Schemas are also XML documentsXML Schemas are also XML documents

Page 28: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Document Type Definition Document Type Definition (DTD)(DTD)

<!ELEMENT CONTACTS (DATABASE, ENTRY+)><!ELEMENT DATABASE (#PCDATA)><!ATTLIST DATABASE USERTYPE (PERSONAL|CORPORATE) "PERSONAL"><!ELEMENT ENTRY (NAME, TITLE, COMPANY, WEBSITE?, ADDRESS, CITY, STATE, ZIP, PHONE, PAGER?, FAX?, EMAIL?)><!ATTLIST ENTRY NUMBER CDATA #IMPLIED><!ELEMENT NAME (LAST_NAME, FIRST_NAME)><!ELEMENT LAST_NAME (#PCDATA)><!ELEMENT FIRST_NAME (#PCDATA)><!ELEMENT TITLE (#PCDATA)><!ELEMENT COMPANY (#PCDATA)><!ELEMENT WEBSITE (#PCDATA)><!ELEMENT ADDRESS (#PCDATA)><!ELEMENT CITY (#PCDATA)><!ELEMENT STATE (#PCDATA)><!ELEMENT ZIP (#PCDATA)><!ELEMENT PHONE (OFFICE?, DIRECT?, CELLULAR?)>. . .ETC.

Page 29: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Validating XMLValidating XML

An XML document that conforms to its An XML document that conforms to its DTD is DTD is validvalid

Validating parsersValidating parsers– IBM's XML4J ParserIBM's XML4J Parser– IBM's DOMit: A servlet for XML validationIBM's DOMit: A servlet for XML validation– IE itself, modified by installing a download IE itself, modified by installing a download

from http://msdn.microsoft.com from http://msdn.microsoft.com (iexmltls.exe)(iexmltls.exe)

Page 30: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Validating XMLValidating XML

http://tinyurl.com/3bh3t

Page 31: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Validating XMLValidating XML

http://tinyurl.com/3f5fp

Page 32: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Validating XMLValidating XML

Page 33: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XSLXSL

Extensible Stylesheet LanguageExtensible Stylesheet Language

Three specificationsThree specifications– XSL Transformations (XSLT)XSL Transformations (XSLT)– XSL Formatting Objects (XSL-FO)XSL Formatting Objects (XSL-FO)– XPath XPath

Previously separate, recently incorporated into Previously separate, recently incorporated into XSLXSL

Page 34: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XSLTXSLT

Transforms XML into other markup Transforms XML into other markup languageslanguages

Often used to transform XML to HTMLOften used to transform XML to HTML Limited query-like functionalityLimited query-like functionality XSL documents are also XML XSL documents are also XML

documentsdocuments

Page 35: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

An XSL DocumentAn XSL Document

<?xml version="1.0" ?><xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"><xsl:template match="/"><html> <head> <title> <xsl:value-of select="CONTACTS/DATABASE" /> </title> </head><body style="background-color: DDDDDD;"> <h2 align="center"> <xsl:value-of select="CONTACTS/DATABASE" /> <hr /> </h2><!-- --> <xsl:for-each select="CONTACTS/ENTRY[COMPANY='SDC, Inc.']" order-by ="NAME/LAST_NAME"> <table align="center" width="400" style="font-family: sans-serif; font-size: 10pt; background-color: EEEEEE;"> <tr> <td width="200"><b> <xsl:value-of select="NAME/FIRST_NAME" />

SELECT

WHERE

ORDER BY

XSLT Query-like

functionality:

Page 36: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

An XSL DocumentAn XSL Document

<?xml version="1.0" ?><xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"><xsl:template match="/"><html> <head> <title> <xsl:value-of select="CONTACTS/DATABASE" /> </title> </head><body style="background-color: DDDDDD;"> <h2 align="center"> <xsl:value-of select="CONTACTS/DATABASE" /> <hr /> </h2><!-- --> <xsl:for-each select="CONTACTS/ENTRY[COMPANY='SDC, Inc.']" order-by ="NAME/LAST_NAME"> <table align="center" width="400" style="font-family: sans-serif; font-size: 10pt; background-color: EEEEEE;"> <tr> <td width="200"><b> <xsl:value-of select="NAME/FIRST_NAME" />

XSLT

XPath

HTML

CSS

Other functionality:

Page 37: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML, XSL and JavaScriptXML, XSL and JavaScript

<html><head><title>Test XML Page</title></head><body><script language = "JavaScript">

var xmlObject = new ActiveXObject("microsoft.xmldom")xmlObject.async = falsexmlObject.load("contacts.xml")

var xslObject = new ActiveXObject("microsoft.xmldom")xslObject.async = falsexslObject.load("contacts.xsl")

document.write(xmlObject.transformNode(xslObject))

</script></body></html>

Page 38: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML, XSL and JavaScriptXML, XSL and JavaScript

See demoSee demo

Page 39: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XSL - Formatting ObjectsXSL - Formatting Objects

Adobe InDesignAdobe InDesign

See other informationSee other information

Page 40: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML and DatabasesXML and Databases

Microsoft SQL ServerMicrosoft SQL Server

Oracle products (various)Oracle products (various)

IBM DB2 UDBIBM DB2 UDB

Page 41: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Microsoft SQL ServerMicrosoft SQL Server SQL can retrieve results in XML formatSQL can retrieve results in XML format Three XML modes: Raw, Auto, ExplicitThree XML modes: Raw, Auto, Explicit Raw mode - result row tagged <row>Raw mode - result row tagged <row> Auto mode - more control over tagsAuto mode - more control over tags Explicit modeExplicit mode

– Default tags - table names, field namesDefault tags - table names, field names– Overwrite by specifying DTD with queryOverwrite by specifying DTD with query– Specify shape of the XML tree Specify shape of the XML tree – Requires relatively complex SQL queriesRequires relatively complex SQL queries

Page 42: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

Oracle ProductsOracle Products

Oracle 8i was billed as “the world’s Oracle 8i was billed as “the world’s first XML-enabled database”first XML-enabled database”

Oracle Reports 6iOracle Reports 6i– Reports can be stored as XSLReports can be stored as XSL

Page 43: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

IBM DB2 UDBIBM DB2 UDB

DB2 XML ExtenderDB2 XML Extender– facility to enable DB2 to work with XMLfacility to enable DB2 to work with XML

Net.DataNet.Data– macro language for DB2 UDBmacro language for DB2 UDB

Page 44: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

IBM DB2 UDBIBM DB2 UDB

DB2 XML ExtenderDB2 XML Extender

– Repository for XML and DTDsRepository for XML and DTDs

– Storage methodsStorage methods XML columnXML column XML collectionXML collection

Page 45: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

IBM DB2 UDBIBM DB2 UDB

XML columnXML column– Entire XML document stored in one Entire XML document stored in one

column as an XML UDTcolumn as an XML UDT– Data Access Definition (DAD) defines Data Access Definition (DAD) defines

indexes based on elements and attributesindexes based on elements and attributes XML collectionXML collection

– Relational tables mapped to/from XMLRelational tables mapped to/from XML– DAD maps DTD to tables and columnsDAD maps DTD to tables and columns

Page 46: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

IBM DB2 UDBIBM DB2 UDB

DB2 XML Extender also allowsDB2 XML Extender also allows

– SQL to query XML based on elements and SQL to query XML based on elements and attributesattributes

– Stored procedures to generate XML from Stored procedures to generate XML from DB2DB2

Page 47: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

IBM DB2 UDBIBM DB2 UDB

Net.DataNet.Data

– Allows conversion of SQL results to XMLAllows conversion of SQL results to XML

– Is not restricted to DB2 UDB as a data Is not restricted to DB2 UDB as a data sourcesource

Page 48: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML and Query LanguagesXML and Query Languages XPathXPath

– not based on XMLnot based on XML– limited functionalitylimited functionality– relatively difficult to understandrelatively difficult to understand

XSLTXSLT– based on XMLbased on XML– works with XPath, XSL-FO, HTML, CSSworks with XPath, XSL-FO, HTML, CSS– also has limited functionalityalso has limited functionality

Page 49: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML and Query LanguagesXML and Query Languages

Per the W3C website:

“The mission of the XML Query project is to provide flexible query facilities to extract data from real and virtual documents on the World Wide Web, therefore finally providing the needed interaction between the Web world and the database world. Ultimately, collections of XML files will be accessed like databases.” (emphasis added)

Page 50: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML Editors - a samplingXML Editors - a sampling

Microsoft - XML NotepadMicrosoft - XML Notepad Wattle Software - XMLWriterWattle Software - XMLWriter Sonic Software - Stylus StudioSonic Software - Stylus Studio Altova - XML SpyAltova - XML Spy

note: this is not a product endorsement

Page 51: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML Editors - XML NotepadXML Editors - XML Notepad

Page 52: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML Servers/DatabasesXML Servers/Databases

IxiaSoft - TEXTML ServerIxiaSoft - TEXTML Server– http://www.ixiasoft.comhttp://www.ixiasoft.com

Software AG - Tamino XML ServerSoftware AG - Tamino XML Server– http://www.tamino.comhttp://www.tamino.com

Ipedo - Ipedo XML Intelligence PlatformIpedo - Ipedo XML Intelligence Platform– http://www.ipedo.comhttp://www.ipedo.com

note: this is not a product endorsement

Page 53: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

XML ResourcesXML Resources

World Wide Web ConsortiumWorld Wide Web Consortium– http://www.w3.orghttp://www.w3.org

The XML Industry PortalThe XML Industry Portal– http://www.xml.orghttp://www.xml.org

XML101.comXML101.com– http://www.xml101.comhttp://www.xml101.com

W3 SchoolsW3 Schools– http://www.w3schools.comhttp://www.w3schools.com

Page 54: An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004

Copyright © 2004 by Michael Mina - [email protected] © 2004 by Michael Mina - [email protected]

<closing><closing>Thank You For AttendingThank You For Attending

</closing></closing>

Michael MinaMichael [email protected]@aol.com