Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004."— Presentation transcript:

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

2 Copyright © 2004 by Michael Mina - mikeamina@aol.com Presentation Overview What is XML? What is XML? Uses of XML Uses of XML XML in relation to other languages XML in relation to other languages Learning basic XML Learning basic XML Publishing with XML Publishing with XML XML and databases XML and databases XML Resources XML Resources

3 Copyright © 2004 by Michael Mina - mikeamina@aol.com What is XML? Extensible Markup Language - born 2/1998 Extensible Markup Language - born 2/1998 Extensible - create new markup languages Extensible - create new markup languages More than HTML, less than SGML More than HTML, less than SGML XML family of specifications XML family of specifications –XML, XSL, XSLT, XSL-FO, DOM, XML Namespaces, XLink, XPointer, XPath, XML Schema, XML Query Language

4 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML Data Storage Data Storage Data Interchange Data Interchange Data Display/Rendering/Publishing Data Display/Rendering/Publishing All of the above are interrelated All of the above are interrelated All of the above are about data All of the above are about data

5 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML Some specific examples Some specific examples –United Way I&R data interchange (call 211) –Dreamweaver extensions –File management of digital photographs –Transmit information from handheld into database (e.g., U-Haul) –CSU data transformation POC model Excel Access XML, XSL –Burden shifting: database server web server Limited only by your imagination (?) Limited only by your imagination (?)

6 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Data Storage Data Storage Data Storage –Products marketed as XML databases Tamino Tamino TEXTML TEXTML –XML-enabled databases Oracle, SQL Server, DB2 Oracle, SQL Server, DB2 note: this is not a product endorsement

7 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses 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 systems –Hierarchical data –Smaller data set * –Speed not critical –Simpler queries used * –Data must be stored for a long time * Becoming less important over time as a consideration

8 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Data Interchange Application Many translators (bridges) vs. a common language XML

9 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Display/Rendering Data Display/Rendering Data Display/Rendering –Present the same content differently for different devices Before XML... Before XML... –Either support older standard only (e.g., HTML 3.2) –Or develop multiple sets of pages and redirect user based on their browser

10 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Display/Rendering With XML... With XML... –One set of XML documents –One XSL document for each browser/device –If a new device or new use for existing device emerges… develop new standard protocol (e.g., WAP) develop new standard protocol (e.g., WAP) develop another XSL document develop another XSL document

11 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Display/Rendering Then either Then either –serve XML and XSL to client Or Or –transform XML with XSL at server –serve appropriate markup to client

12 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Publishing XMetaL Documentum Platform Repurposing of content HTML note: this is not a product endorsement content authoring tool content storage management PDF MS Word content WAP

13 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - Publishing In 2002, the USAF AWACS technical documentation was converted to XML Photo from http://www.nato.int

14 Copyright © 2004 by Michael Mina - mikeamina@aol.com Uses of XML - burden shifting client web server database server client web server database server XML Reduce the burden on a database server

15 Copyright © 2004 by Michael Mina - mikeamina@aol.com Why is XML needed? Consider HTML Consider HTML –HyperText Markup Language –Based on SGML –Most web pages use HTML

16 Copyright © 2004 by Michael Mina - mikeamina@aol.com Why is XML needed? Advantages of HTML Advantages of HTML –Easy to learn compared to most programming languages Readily available authoring tools (even a text file editor) Readily available authoring tools (even a text file editor) Readily available rendering tool Readily available rendering tool Browsers are free, all new PCs have browsers installed Browsers are free, all new PCs have browsers installed

17 Copyright © 2004 by Michael Mina - mikeamina@aol.com Why is XML needed? Disadvantages of HTML Disadvantages of HTML –Deviation from its original purpose Presentation should be based on a styling language Presentation should be based on a styling language –Lack of extensibility –Toleration of faulty code acceptable for web page design acceptable for web page design unacceptable for transmission of data unacceptable for transmission of data

18 Copyright © 2004 by Michael Mina - mikeamina@aol.com Why is XML needed? Consider SGML Consider SGML –Standard Generalized Markup Language No toleration of faulty code No toleration of faulty code Completely extensible Completely extensible –HTML, XML based on SGML

19 Copyright © 2004 by Michael Mina - mikeamina@aol.com Why is XML needed? The advantages of SGML are actually disadvantages in the web environment The advantages of SGML are actually disadvantages in the web environment Complete extensibility of SGML means Complete extensibility of SGML means –It is not cost-effective to develop browsers to support SGML –Potentially huge bandwidth and storage issues

20 Copyright © 2004 by Michael Mina - mikeamina@aol.com Why is XML needed? XML allows the use of metadata - data about data XML allows the use of metadata - data about data HTML tags HTML tags – The Gettysburg Address was written by Abraham Lincoln – The Gettysburg Address was written by Abraham Lincoln XML elements XML elements – The Gettysburg Address was written by Abraham Lincoln – The Gettysburg Address was written by Abraham Lincoln

21 Copyright © 2004 by Michael Mina - mikeamina@aol.com SGML, XML, HTML XML and HTML are subsets of SGML XHTML is HTML rewritten as an XML-based language SGML HTMLXML XHTML

22 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML-based languages XML extensibility has led to XML extensibility has led to –Extensible Business Reporting Language (XBRL) –Security Assertion Markup Language (SAML) –Predictive Model Markup Language (PMML) –CellML to store and exchange computer-based biological models. to store and exchange computer-based biological models. –HR-XML consortium... an independent, non-profit organization dedicated to the development and promotion of a standard suite of XML specifications to enable e-business and the automation of human resources-related data exchanges.... an independent, non-profit organization dedicated to the development and promotion of a standard suite of XML specifications to enable e-business and the automation of human resources-related data exchanges. –Many others

23 Copyright © 2004 by Michael Mina - mikeamina@aol.com Basic XML Contact List Sanford Bill VP, Controller SDC, Inc. www.sdcinc.biz 4132 Homestead Rd. Parma OH 44134 440-398-2098 440-123-4567 bsanford@sdc.biz XML Markup includes: XML declaration Root Element Elements Attributes Entities

24 Copyright © 2004 by Michael Mina - mikeamina@aol.com XHTML Next-generation of HTML Next-generation of HTML HTML specification rewritten to be XML compliant HTML specification rewritten to be XML compliant XML is not going to replace HTML, XHTML is XML is not going to replace HTML, XHTML is Differences between HTML, XHTML include: Differences between HTML, XHTML include: –lower case tags required –proper nesting and closure of tags –quoting attributes

25 Copyright © 2004 by Michael Mina - mikeamina@aol.com Parsers A parser is a program that processes an XML document. A parser is a program that processes an XML document. IE includes a parser that allows the rendering of XML documents. IE includes a parser that allows the rendering of XML documents. Parsers are either validating or non-validating. Parsers are either validating or non-validating.

26 Copyright © 2004 by Michael Mina - mikeamina@aol.com Well-formedness An XML document is well-formed if An XML document is well-formed if –attribute values are in quotes –tags are properly nested –start and end tags are the same case –there is one root element –empty elements must be formatted properly If its not well-formed, its not XML If its not well-formed, its not XML

27 Copyright © 2004 by Michael Mina - mikeamina@aol.com Document Type Definition (DTD) Used to specify how elements, attributes, etc. relate to each other Used to specify how elements, attributes, etc. relate to each other DTDs are not XML documents, but are used by them DTDs are not XML documents, but are used by them DTDs do not support data typing DTDs do not support data typing XML Schema was developed in part to address lack of data typing in DTDs XML Schema was developed in part to address lack of data typing in DTDs XML Schemas are also XML documents XML Schemas are also XML documents

28 Copyright © 2004 by Michael Mina - mikeamina@aol.com Document Type Definition (DTD)... ETC.

29 Copyright © 2004 by Michael Mina - mikeamina@aol.com Validating XML An XML document that conforms to its DTD is valid An XML document that conforms to its DTD is valid Validating parsers Validating parsers –IBM's XML4J Parser –IBM's DOMit: A servlet for XML validation –IE itself, modified by installing a download from http://msdn.microsoft.com (iexmltls.exe)

30 Copyright © 2004 by Michael Mina - mikeamina@aol.com Validating XML http://tinyurl.com/3bh3t

31 Copyright © 2004 by Michael Mina - mikeamina@aol.com Validating XML http://tinyurl.com/3f5fp

32 Copyright © 2004 by Michael Mina - mikeamina@aol.com Validating XML

33 Copyright © 2004 by Michael Mina - mikeamina@aol.com XSL Extensible Stylesheet Language Extensible Stylesheet Language Three specifications Three specifications –XSL Transformations (XSLT) –XSL Formatting Objects (XSL-FO) –XPath Previously separate, recently incorporated into XSL Previously separate, recently incorporated into XSL

34 Copyright © 2004 by Michael Mina - mikeamina@aol.com XSLT Transforms XML into other markup languages Transforms XML into other markup languages Often used to transform XML to HTML Often used to transform XML to HTML Limited query-like functionality Limited query-like functionality XSL documents are also XML documents XSL documents are also XML documents

35 Copyright © 2004 by Michael Mina - mikeamina@aol.com An XSL Document SELECT WHERE ORDER BY XSLT Query-like functionality:

36 Copyright © 2004 by Michael Mina - mikeamina@aol.com An XSL Document XSLT XPath HTML CSS Other functionality:

37 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML, XSL and JavaScript Test XML Page var xmlObject = new ActiveXObject("microsoft.xmldom") xmlObject.async = false xmlObject.load("contacts.xml") var xslObject = new ActiveXObject("microsoft.xmldom") xslObject.async = false xslObject.load("contacts.xsl") document.write(xmlObject.transformNode(xslObject))

38 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML, XSL and JavaScript See demo See demo

39 Copyright © 2004 by Michael Mina - mikeamina@aol.com XSL - Formatting Objects Adobe InDesign Adobe InDesign See other information See other information

40 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML and Databases Microsoft SQL Server Microsoft SQL Server Oracle products (various) Oracle products (various) IBM DB2 UDB IBM DB2 UDB

41 Copyright © 2004 by Michael Mina - mikeamina@aol.com Microsoft SQL Server SQL can retrieve results in XML format SQL can retrieve results in XML format Three XML modes: Raw, Auto, Explicit Three XML modes: Raw, Auto, Explicit Raw mode - result row tagged Raw mode - result row tagged Auto mode - more control over tags Auto mode - more control over tags Explicit mode Explicit mode –Default tags - table names, field names –Overwrite by specifying DTD with query –Specify shape of the XML tree –Requires relatively complex SQL queries

42 Copyright © 2004 by Michael Mina - mikeamina@aol.com Oracle Products Oracle 8i was billed as the worlds first XML- enabled database Oracle 8i was billed as the worlds first XML- enabled database Oracle Reports 6i Oracle Reports 6i –Reports can be stored as XSL

43 Copyright © 2004 by Michael Mina - mikeamina@aol.com IBM DB2 UDB DB2 XML Extender DB2 XML Extender –facility to enable DB2 to work with XML Net.Data Net.Data –macro language for DB2 UDB

44 Copyright © 2004 by Michael Mina - mikeamina@aol.com IBM DB2 UDB DB2 XML Extender DB2 XML Extender –Repository for XML and DTDs –Storage methods XML column XML column XML collection XML collection

45 Copyright © 2004 by Michael Mina - mikeamina@aol.com IBM DB2 UDB XML column XML column –Entire XML document stored in one column as an XML UDT –Data Access Definition (DAD) defines indexes based on elements and attributes XML collection XML collection –Relational tables mapped to/from XML –DAD maps DTD to tables and columns

46 Copyright © 2004 by Michael Mina - mikeamina@aol.com IBM DB2 UDB DB2 XML Extender also allows DB2 XML Extender also allows –SQL to query XML based on elements and attributes –Stored procedures to generate XML from DB2

47 Copyright © 2004 by Michael Mina - mikeamina@aol.com IBM DB2 UDB Net.Data Net.Data –Allows conversion of SQL results to XML –Is not restricted to DB2 UDB as a data source

48 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML and Query Languages XPath XPath –not based on XML –limited functionality –relatively difficult to understand XSLT XSLT –based on XML –works with XPath, XSL-FO, HTML, CSS –also has limited functionality

49 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML 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)

50 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML Editors - a sampling Microsoft - XML Notepad Microsoft - XML Notepad Wattle Software - XMLWriter Wattle Software - XMLWriter Sonic Software - Stylus Studio Sonic Software - Stylus Studio Altova - XML Spy Altova - XML Spy note: this is not a product endorsement

51 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML Editors - XML Notepad

52 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML Servers/Databases IxiaSoft - TEXTML Server IxiaSoft - TEXTML Server –http://www.ixiasoft.com Software AG - Tamino XML Server Software AG - Tamino XML Server –http://www.tamino.com Ipedo - Ipedo XML Intelligence Platform Ipedo - Ipedo XML Intelligence Platform –http://www.ipedo.com note: this is not a product endorsement

53 Copyright © 2004 by Michael Mina - mikeamina@aol.com XML Resources World Wide Web Consortium World Wide Web Consortium –http://www.w3.org The XML Industry Portal The XML Industry Portal –http://www.xml.org XML101.com XML101.com –http://www.xml101.com W3 Schools W3 Schools –http://www.w3schools.com

54 Copyright © 2004 by Michael Mina - mikeamina@aol.com Thank You For Attending Thank You For Attending Michael Mina mikeamina@aol.com


Download ppt "An Introduction to XML Joint Presentation to the CDPUG and GCPCUG Web Publishing SIG - August 26, 2004."

Similar presentations


Ads by Google