Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pragmatic XML By Peter Kriens, CEO aQute www.aQute.se.

Similar presentations


Presentation on theme: "Pragmatic XML By Peter Kriens, CEO aQute www.aQute.se."— Presentation transcript:

1 Pragmatic XML By Peter Kriens, CEO aQute www.aQute.se

2 www.aQute.se - 2002 XML Portland - 2 Contents The Problem The Problem Technologies Technologies Coordination Coordination Products Products Conclusions Conclusions

3 www.aQute.se - 2002 XML Portland - 3 The Problem The OOPSLA (Object Oriented Programming Systems Languages and Applications) conference is held yearly since 1986 The OOPSLA (Object Oriented Programming Systems Languages and Applications) conference is held yearly since 1986 Organization consists of a professional office and many volunteers Organization consists of a professional office and many volunteers There are many different publications There are many different publications – Advance and Final program – Web site, PDA

4 www.aQute.se - 2002 XML Portland - 4 The Problem Committee OOPSLA Office Exhibitions Participants Committee Sub Committee Participants Exhibitor Local info Final Program Advance Program PDA WWW Palm Pilot Pocket PC Printer editor Web master Pda handler schedule

5 www.aQute.se - 2002 XML Portland - 5 The Problem Daily events: Daily events: – The web master corrects an error in a web page but the Final Program is not updated. – A room number is changed, but the change is not made in the PDA. So, the third law of Kriens So, the third law of Kriens – Changes that must be made in multiple places are not

6 www.aQute.se - 2002 XML Portland - 6 The Problem Coordinating this many publications, with so many volunteers, is a nightmare. Coordinating this many publications, with so many volunteers, is a nightmare. How can we prevent the need for multiple updates? How can we prevent the need for multiple updates?

7 www.aQute.se - 2002 XML Portland - 7 The Solution? Committee OOPSLA Office Exhibitions Participants Committee Sub Committee Participants Exhibitor Local info Final Program Advance Program PDA WWW Palm Pilot Pocket PC Printer schedule ? transformer

8 www.aQute.se - 2002 XML Portland - 8 merge XSL Overall Workflow Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

9 www.aQute.se - 2002 XML Portland - 9 Meet XML What is XML? What is XML? – A standard for describing structured information For example For example – Personal information – Congress events and programs – Book content

10 www.aQute.se - 2002 XML Portland - 10 Meet XML Example Congress Event: Example Congress Event: – Onward! Dick Gabriel dick@gabriel.com Ralph Lauren rl@acm.org … – Onward! Dick Gabriel dick@gabriel.com Ralph Lauren rl@acm.org …

11 www.aQute.se - 2002 XML Portland - 11 Meet XML event titleauthorsdescription author titleemail *

12 www.aQute.se - 2002 XML Portland - 12 Meet XML event titleauthorsdescription author titleemail author titleemail id="onw-1"... Dick Gabrieldick@gabriel.comRalph Laurenrl@acm.org Onward title! tag element attribute text

13 www.aQute.se - 2002 XML Portland - 13 Meet XML Strong Points Strong Points – Flexible character encoding, based on Unicode but supporting many other code sets: – Flexible character encoding, based on Unicode but supporting many other code sets: – Based on a text stream Text files, database, network Text files, database, network – Defined structure in a Data Type Definition (DTD) that simplifies the processing

14 www.aQute.se - 2002 XML Portland - 14 Meet XML Weak points Weak points – Very verbose – Hard to read – No clear distinction between attributes and sub- elements 65536 65536 – A lot of rope to hang yourself

15 www.aQute.se - 2002 XML Portland - 15 merge XSL The XSL parts Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver Plucker Palm files HTML web pages XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

16 www.aQute.se - 2002 XML Portland - 16 Meet XSLT XSL is driven by a "stylesheet" XSL is driven by a "stylesheet" – Read 1 or more input files – Create 1 or more output files What can we do with XSLT? What can we do with XSLT? – Reorder, Add fixed elements, Select – Merge, Calculate This is possible because the data in an XML file has now a name through the tag This is possible because the data in an XML file has now a name through the tag

17 www.aQute.se - 2002 XML Portland - 17 Meet XSLT Structure versus Markup Structure versus Markup In HTML, tags are used for mark-up In HTML, tags are used for mark-up Onward! Onward! In XML, tags are used for semantics In XML, tags are used for semantics rl@acm.org rl@acm.org The tag (and its position) identify the meaning of the element. The tag (and its position) identify the meaning of the element. Transformers transform the meaning into markup Transformers transform the meaning into markup

18 www.aQute.se - 2002 XML Portland - 18 Meet XSLT Tutorials Sherman Alpert Objects revisited DesignFest Gail Harris E-commerce Counting Fries Cellular Networks Index DesignFest 1. Cellular Networks 2. Counting Fries 3. E-commerce Tutorials 1. Objects Revisited

19 www.aQute.se - 2002 XML Portland - 19 Meet XSLT The XML coded data is neutral to the application so different transformers can markup for: The XML coded data is neutral to the application so different transformers can markup for: – Different type of documents Advance Program, PDA, Final Program, Web Advance Program, PDA, Final Program, Web – Different formats Framemaker, XSL:FO, Word, PDF Framemaker, XSL:FO, Word, PDF Transformers can be any program but XSL is designed for this purpose Transformers can be any program but XSL is designed for this purpose

20 www.aQute.se - 2002 XML Portland - 20 Meet XPath Selects elements from a document Selects elements from a document Provides Functions Provides Functions Examples Examples – //title – //author[email] – count(author)>=1 – //program[@id='tec' or @id='pap' or @id='onw' or @id='pra' or @id='pan' or @id='web']/event

21 www.aQute.se - 2002 XML Portland - 21 Meet XSLT XSLT is an XML file that describes how another XML file must be transformed XSLT is an XML file that describes how another XML file must be transformed Index ( )

22 www.aQute.se - 2002 XML Portland - 22 Meet XSLT n n Defines that we use XML version 1 and use the standard ISO-8859-1 character set in the file Defines that we use XML version 1 and use the standard ISO-8859-1 character set in the file Defines a stylesheet element Defines a stylesheet element The xsl: is called a namespace The xsl: is called a namespace The URL uniquely identifies the xsl prefix The URL uniquely identifies the xsl prefix

23 www.aQute.se - 2002 XML Portland - 23 Meet XSLT A template describes a transformation. This template will match the conference element from the input A template describes a transformation. This template will match the conference element from the input Inside the xsl:template element, the conference is the current element. Inside the xsl:template element, the conference is the current element. Index Index Insert a fixed text header. Because this element does not have the xls: namespace, it is inserted in the output Insert a fixed text header. Because this element does not have the xls: namespace, it is inserted in the output

24 www.aQute.se - 2002 XML Portland - 24 Meet XSLT Insert the title of the program. This is a program title. Insert the title of the program. This is a program title. Insert the tag to number the following elements Insert the tag to number the following elements n n Sort the events on title and iterate over them. Each event under a program becomes the current element Sort the events on title and iterate over them. Each event under a program becomes the current element

25 www.aQute.se - 2002 XML Portland - 25 Meet XSLT Repeat for each element under conference that has the name "program". The sort element indicates which field should be sorted. Repeat for each element under conference that has the name "program". The sort element indicates which field should be sorted. Inside the xsl:for-each element, each program is selected and becomes the current element. Inside the xsl:for-each element, each program is selected and becomes the current element.

26 www.aQute.se - 2002 XML Portland - 26 Meet XSLT n n Output the event title Output the event title n n Close all the open elements Close all the open elements

27 www.aQute.se - 2002 XML Portland - 27 Demo

28 www.aQute.se - 2002 XML Portland - 28 merge XSL Overall Workflow Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

29 www.aQute.se - 2002 XML Portland - 29 Meet MIF XSLT only restructures XSLT only restructures No formatting and pagination No formatting and pagination This is delegated to XSL:FO, which is still immature This is delegated to XSL:FO, which is still immature Framemaker is much better Framemaker is much better – Large documents – Centralized paragraph and character styles – etc.

30 www.aQute.se - 2002 XML Portland - 30 Meet MIF MIF is a generic import format for Framemaker MIF is a generic import format for Framemaker – Framemaker version independent Gets formatting from template Gets formatting from template Pure text, similar to XML, but not the same Pure text, similar to XML, but not the same #ParaLine > #Para

31 www.aQute.se - 2002 XML Portland - 31 Meet MIF Close to XML Close to XML Uses Uses Very difficult to generate MIF with XSLT because Very difficult to generate MIF with XSLT because – must be escaped into < and > – Character encoding issues – XSLT is a lousy programming language!

32 www.aQute.se - 2002 XML Portland - 32 Meet MIF Framemaker can be used interactively or in batch mode Framemaker can be used interactively or in batch mode – also on PC with dzbatcher Generates PDF Generates PDF Provides a very rich formatting environment Provides a very rich formatting environment Stable Stable Mature Mature

33 www.aQute.se - 2002 XML Portland - 33 merge XSL Overall Workflow Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

34 www.aQute.se - 2002 XML Portland - 34 Meet XHTML XHTML is similar to HTML XHTML is similar to HTML XHTML is valid HTML and XML XHTML is valid HTML and XML All tags are closed All tags are closed – Not but – Not but – Not … … … but … … – Not … … … but … … Has XML header Has XML header

35 www.aQute.se - 2002 XML Portland - 35 merge XSL Overall Workflow Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

36 www.aQute.se - 2002 XML Portland - 36 Meet Java Not all conversions were feasible in XML/XSLT Not all conversions were feasible in XML/XSLT This happens when an input or output file is not in XML format This happens when an input or output file is not in XML format – XSLT can not handle this well Programs Programs – XML2MIF – Driver

37 www.aQute.se - 2002 XML Portland - 37 Meet XML2MIF Developed a Java Program to convert an XML file (with HTML like schema) to MIF Developed a Java Program to convert an XML file (with HTML like schema) to MIF Tested several third party apps, none worked Tested several third party apps, none worked Java is ideal for these kind of applications Java is ideal for these kind of applications – Free – Unicode support – Many XML parsers available

38 www.aQute.se - 2002 XML Portland - 38 Meet XML2MIF Character encoding Character encoding Converting text to MIF paragraphs Converting text to MIF paragraphs – Automatic { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/2/732804/slides/slide_38.jpg", "name": "www.aQute.se - 2002 XML Portland - 38 Meet XML2MIF Character encoding Character encoding Converting text to MIF paragraphs Converting text to MIF paragraphs – Automatic

39 www.aQute.se - 2002 XML Portland - 39 Meet XML2MIF 13:30-17:00, Thursday afternoon Tutorials: How to Use Design Patterns In Java and.NET, #ParaLine > #Para #ParaLine #XRef > #ParaLine > #Para 13:30-17:00, Thursday afternoon Tutorials: How to Use Design Patterns In Java and.NET,

40 www.aQute.se - 2002 XML Portland - 40 Meet Driver Bad name! Bad name! The web master had coded previous sites in HTML The web master had coded previous sites in HTML This HTML was not easy to re-code in XHTML so we could not parse it This HTML was not easy to re-code in XHTML so we could not parse it Driver reads an HTML file and inserts information from the XHTML in appropriate places Driver reads an HTML file and inserts information from the XHTML in appropriate places – title – body

41 www.aQute.se - 2002 XML Portland - 41 Meet Driver

42 www.aQute.se - 2002 XML Portland - 42 merge XSL Overall Workflow Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

43 www.aQute.se - 2002 XML Portland - 43 Meet Plucker A public domain HTML reader for Palm Pilots A public domain HTML reader for Palm Pilots Requires simplified HTML Requires simplified HTML Consists of a conversion program that reads an HTML file and compacts all linked files in to an archive Consists of a conversion program that reads an HTML file and compacts all linked files in to an archive Converts images Converts images Can be downloaded from www.plucker.org Can be downloaded from www.plucker.org Has some usability problems Has some usability problems

44 www.aQute.se - 2002 XML Portland - 44 Meet CVS CVS Build system Web server programmers committee Publicity chair Editor MIF files XML files XML files and PDF XML files XML, HTML and PDF files XSL files

45 www.aQute.se - 2002 XML Portland - 45 Meet CVS Concurrent Version System Concurrent Version System Allows multiple people to edit files simultaneously Allows multiple people to edit files simultaneously Revisions are automatically merged Revisions are automatically merged Conflicts must be manually resolved Conflicts must be manually resolved Triggers a build after every change Triggers a build after every change – Web pages, MIF files, PDA files Very friendly client: TortoiseCVS Very friendly client: TortoiseCVS – Integrates with MS Explorer

46 www.aQute.se - 2002 XML Portland - 46 TortoiseCVS

47 www.aQute.se - 2002 XML Portland - 47 merge XSL Preparing Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

48 www.aQute.se - 2002 XML Portland - 48 Authoring Every chair has his own XML file Every chair has his own XML file – No editor was provided – Not everybody can handle text files well Was simple but powerful Was simple but powerful

49 www.aQute.se - 2002 XML Portland - 49 XML Scheme for Events top program event locationtitle author chairabstractsmallabstractxref subeventabstractsmallabstract titleabstractsmallabstractauthor category trackformatlevel author or chair rolenametitleaffiliationimg * * * * *** * * OO O O OO O *

50 www.aQute.se - 2002 XML Portland - 50 Authoring Validation can be done in Internet Explorer Validation can be done in Internet Explorer Next year we need more up-front validation because chairs made many errors Next year we need more up-front validation because chairs made many errors

51 www.aQute.se - 2002 XML Portland - 51

52 www.aQute.se - 2002 XML Portland - 52 Merge and insert The XML data files are merged into a single XML file The XML data files are merged into a single XML file During the merge, calculated fields were added to simplify later processing During the merge, calculated fields were added to simplify later processing Overall information came from a separate overall.xml file Overall information came from a separate overall.xml file – Calendar with day names (Thursday) – Tracks – Included programs

53 www.aQute.se - 2002 XML Portland - 53 merge XSL Printed Material Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

54 www.aQute.se - 2002 XML Portland - 54 Creating the AP and FP The all.xml is transformed into a XHTML file The all.xml is transformed into a XHTML file – Looks like HTML – Can be viewed in browser The result is transformed into an XMIF file The result is transformed into an XMIF file – Has the MIF structure with frames but is still XML The XMIF file is transformed into a MIF file with the HTML2MIF converter The XMIF file is transformed into a MIF file with the HTML2MIF converter

55 www.aQute.se - 2002 XML Portland - 55 Creating the AP and FP The MIF file is automatically made available on the web when its sources have changed The MIF file is automatically made available on the web when its sources have changed Editor fetches it and Editor fetches it and – Applies template – Does manual editing (!) – Creates PDF – Stores this on the server via CVS – Result becomes available on the web

56 www.aQute.se - 2002 XML Portland - 56 AP/FP Structure AP Intro GlanceBy Track Technical Program IntroGlanceSpeakersPapersPractionersPanelsOnward Web Services Details TP TutorialsWorkshopDesignfest Educators Symposium Doctoral Symposium Demos Doctoral Symposium Posters Student Compet. Special Events Student Volunteers Exhibits At a glance Event details Summary

57 www.aQute.se - 2002 XML Portland - 57

58 www.aQute.se - 2002 XML Portland - 58

59 www.aQute.se - 2002 XML Portland - 59 merge XSL The Web Site Source XML XSLT XHTMLMIF fileXML2MIFPDF Frame maker Template Source XML XSLTXMIF XSLT HTML Driver PluckerPRC HTML XHTML HTML XSLT All XML web.xsl pda.xslap.xsl driver.xml html2mif.xsl overall XML

60 www.aQute.se - 2002 XML Portland - 60 Web pages The web.xsl XSLT script reads the all.xml file and generates a page for The web.xsl XSLT script reads the all.xml file and generates a page for – Each program – Each event – At a glance by track (defined in overall.xml) – By day (also defined in overall.xml) All pages are then merged with a template All pages are then merged with a template

61 www.aQute.se - 2002 XML Portland - 61

62 www.aQute.se - 2002 XML Portland - 62 PDA First generated web pages that were optimized for small devices First generated web pages that were optimized for small devices These were made available on the web for AvantGo users. These were made available on the web for AvantGo users. These pages were converted into plucker and made available as downloads These pages were converted into plucker and made available as downloads

63 www.aQute.se - 2002 XML Portland - 63

64 www.aQute.se - 2002 XML Portland - 64 Tools Used Saxon XSLT: saxon.sourceforge.net Saxon XSLT: saxon.sourceforge.net Framemaker: www.adobe.com Framemaker: www.adobe.com Java: java.sun.com Java: java.sun.com CVS: www.cvshome.org CVS: www.cvshome.org TortoiseCVS: client www.tortoisecvs.org TortoiseCVS: client www.tortoisecvs.org Apache web server: www.apache.org Apache web server: www.apache.org Plucker: www.plucker.org Plucker: www.plucker.org

65 www.aQute.se - 2002 XML Portland - 65 Conclusion Overall system worked very well Overall system worked very well The web pages were only partly used due to "political" problems, but they were fully generated The web pages were only partly used due to "political" problems, but they were fully generated XML was OK for this crowd, but it is probably necessary to use a web page for editing with validation XML was OK for this crowd, but it is probably necessary to use a web page for editing with validation Many more possibilities Many more possibilities – Audio/Visual, room assignments, signage

66 www.aQute.se - 2002 XML Portland - 66 Questions?Contact:Peter.Kriens@aQute.se +46 300 39800


Download ppt "Pragmatic XML By Peter Kriens, CEO aQute www.aQute.se."

Similar presentations


Ads by Google