Your SlideShare is downloading. ×
The Mythical XML
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

The Mythical XML

919
views

Published on

Location: Speaker's Session, Hong Kong Computer Society XML Specialist Group, Hong Kong Polytechnic University / …

Location: Speaker's Session, Hong Kong Computer Society XML Specialist Group, Hong Kong Polytechnic University /
Event Date: Aug 23, 2003 /
Organization: Hong Kong Computer Society

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
919
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. The Mythical XMLMr. Thomas LeeCenter for E-Commerce Infrastructure Development(CECID), The University of Hong KongHK Computer Society XML Specialist GroupSpeaker’s Session26 August 2003, HK Polytechnic University
  • 2. Agenda XML Basis Web Services XML Development in HK Demo26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 2
  • 3. XML Basis
  • 4. True or False? XML = Extensible Markup Language XML is an extension of HTML – XML is going to replace HTML for Web browsing Tags are not predefined in XML – You must define your own tags XML specifies data semantics26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 4
  • 5. Background of XML eXtensible Markup Language XML 1.0 became a W3C Recommendation in 1998 F.O.X (Father of XML) - Jon Bosak – a SUN architect, who led a group to create XML Over 20 XML-related specs at W3C in 2003 Over 200 XML application standards for different industries registered at XML.org – Finance, healthcare, e-government, mathematic, telecom…26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 5
  • 6. What is XML? A markup language for documents containing structured information – i.e. a data format for structurally delimiting text data with tags For computer-to-computer communication HTML XML Encode content and Encode structure + content presentation (no presentation) Tags are already defined for Tags are to be defined by rendering the content on different applications for browsers (one application only) processing the content Semantics has already been Semantics is not defined in defined in HTML spec XML spec XML is not going to replace HTML26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 6
  • 7. WeatherForecastinBrowser26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 7
  • 8. Weather Forecast in HTML26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 8
  • 9. Weather Forecast in XML Start Tag1. <?xml version="1.0"?>2. <WeatherForecast> Element3. <City name="Hong Kong">4. <Weather date="2003-08-26">Light Rain</Weather>5. <Weather date="2003-08-27">Showers</Weather>6. </City>7. <City name="Beijing"> Attribute8. <Weather date="2003-08-26">Cloudy</Weather>9. <Weather date="2003-08-27">Thunder Shower</Weather>10. </City> Data Value11. </WeatherForecast> End Tag26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 9
  • 10. XML Document Structure WeatherForecast City: City: name=“Hong Kong” name=“Beijing” Weather: Weather: Weather: Weather:date=“2003-08-26” date=“2003-08-27” date=“2003-08-26” date=“2003-08-27” Light Rain Showers Cloudy Thunder Showers 26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 10
  • 11. XSLT XML Stylesheet Language Transformation A scripting language to transform a XML document to different document forms – another XML form, HTML, text, etc. Can present XML data in different rendering languages, e.g. HTML, WML – separation of content and presentation Can translate to a different XML form (conforming to a different XML schema) – interoperability between different applications, e.g. vendor products26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 11
  • 12. XSLT Example<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <html> <head> <title>Weather Forecast</title> </head> <body> <h1>Weather Forecast</h1> <xsl:apply-templates/> </body> </html> </xsl:template>26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 12
  • 13. XSLT Example (2) <xsl:template match="City"> <h2> <xsl:apply-templates select="@name"/> </h2> <table border="1"> <tbody> <tr> <th>Date</th> <th>Weather</th> </tr> <xsl:apply-templates/> </tbody> </table> </xsl:template>26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 13
  • 14. XSLT Example (3) <xsl:template match="Weather"> <tr> <td> <xsl:apply-templates select="@date"/> </td> <td> <xsl:apply-templates select="text()"/> </td> </tr> </xsl:template></xsl:stylesheet>26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 14
  • 15. Schema Language A schema language is used to validate the XML data whether it is in valid form for a specific application – the tag set – the structure in which the tags can be placed – the format of the values marked-up by tags and attributes values Data Type Definition (DTD) and W3C XML Schema To define an XML application standard – e.g. XBRL (XML Business Reporting Language) Not sufficient define semantics – semantics is defined in a supplementary vocabulary or specification Not designed to program application logic – e.g. cannot convert temperature between degrees Celsius and Fahrenheit26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 15
  • 16. XML Schema Example<?xml version="1.0" encoding="UTF-8"?> encoding="UTF-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> xs:schema xmlns: xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="WeatherForecast"> xs:element name="WeatherForecast"> <xs:complexType> xs: complexType> <xs:sequence> xs:sequence> <xs:element name="City" minOccurs="0" maxOccurs="unbounded"> xs:element name="City" minOccurs="0 maxOccurs="unbounded"> <xs:complexType> xs: complexType> <xs:sequence> xs:sequence> <xs:element name="Weather" minOccurs="0" maxOccurs="unbounded"> xs:element name="Weather" minOccurs="0 maxOccurs="unbounded"> <xs:complexType> xs: complexType> <xs:simpleContent> xs: simpleContent> <xs:extension base="xs:string"> xs:extension base="xs:string"> <xs:attribute name="date" type="xs:date" use="required"/> xs:attribute name="date" type="xs:date" use="required"/> </xs:extension> </xs:extension> </xs:simpleContent> </xs:simpleContent> </xs:complexType> </xs:complexType> </xs:element> </xs:element> </xs:sequence> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> </xs:complexType> </xs:element> </xs:element> </xs:sequence> </xs:sequence> </xs:complexType> </xs:complexType> </xs:element> </xs:element></xs:schema></xs:schema>26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 16
  • 17. True or False (Answers) XML = Extensible Markup Language XML is an extension of HTML – XML is going to replace HTML for Web browsing Tags are not predefined in XML – You must define your own tags XML specifies data semantics26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 17
  • 18. Web Services
  • 19. Weather Info Everywhere26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 19
  • 20. How to Automatically ObtainWeather Info from HKO? Now: – poll HKO web pages – “try” to decode the text contained within (based on the current web page layout) – 300+ have registered web sites, mass media, telecom operators using this method – problem: a slight change to layout or data format would cause problems to these users Better solution: – Use Web Services26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 20
  • 21. What is Web Service? Remote procedure call (distributed computing) on the Internet using XML Exposes functionality through a standard protocol Describes the interfaces in enough detail to for building client applications to talk to them Registers the services so that potential users can find them easily26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 21
  • 22. SOAP Simple Object Access Protocol Uses XML to package input and output data on making a remote procedure call (RPC) on the Internet Uses Internet protocols for data transport, e.g. HTTP, SMTP – Firewall friendly Platform independent – .Net and Java programs can talk with each other in SOAP http://www.w3c.org26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 22
  • 23. SOAP RequestPOST /weatherwarning/services/WeatherWarning HTTP/1.0Content-Type: text/xml; charset=utf-8Accept: application/soap+xml, application/dime, multipart/related, text/*User-Agent: Axis/1.1RC2Host: 127.0.0.1Cache-Control: no-cachePragma: no-cacheSOAPAction: ""Content-Length: ###<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body> <ns1:getWarning soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://model.weatherwarning.webservice.hko.cecid.hku.hk"/> <ns1:type>typhoon</ns1:type> </ns1:getWarning></soapenv:Body></soapenv:Envelope>26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 23
  • 24. SOAP ResponseHTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Date: Tue, 26 Aug 2003 02:25:37 GMTServer: Apache Coyote/1.0Connection: close<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body> <ns1:getWarningResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://model.weatherwarning.webservice.hko.cecid.hku.hk"> <return xsi:type="xsd:string">強烈季候風信號</return> </ns1:getWarningResponse></soapenv:Body></soapenv:Envelope>26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 24
  • 25. WSDL Web Services Description Language Specifies the data types and structures (in XML Schema) of input and output data for a SOAP call Specifies other transport parameters, e.g. protocol, URL end-point, etc. Tells the clients how to make a SOAP call to use a specific Web Service – similar to Interface definition language (IDL) for RPC http://www.w3c.org26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 25
  • 26. UDDI Universal Description, Discovery and Integration A registry to register, publish, find Web Services – white pages, or basic identification: name, address, and key points of contact – yellow pages, or classification by a standard index of business and industries – green pages, or technical capabilities and services related to the conduct of electronic business Similar to a portal for system clients http://www.uddi.org26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 26
  • 27. ebXML E-business XML Co-developed by UN/CEFACT and OASIS XML-based document exchange architecture to perform Electronic Data Interchange (EDI) on the Internet Provides reliable and secure document exchange on the Internet Supports business process specification for system execution Widely adopted in Asia and Europe – HK is an ebXML forerunner26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 27
  • 28. XML Development in HK
  • 29. eProcurement Case MTRC purchases office supplies from Saggio on SaggioDirect.com Past: plentiful of delivery notes, invoices, monthly statements were sent in paper and reconciled manually Present: XML documents are transferred on the Internet using ebXML – automatic reconciliation – save costs and trees – procurement data ready for analysis and planning26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 29
  • 30. eProcurement with ebXML Delivery goods Saggio Logistics MTRC Users SaggioDirect System Workstations MTRC Intranet System Web Internet Server Intranet Server XML document Hermes Extract data XML document from XML Hermes document26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 30
  • 31. eLogistics Case Shipping companies electronically submit dangerous goods manifests to Marine Department using ebXML Participating pilot shipping companies: OOCL and APL Pilot production in July 2003 Saved data reentry required by Web Will cover other port formality documents, e.g. pre- arrival notification, general declaration… Issue: need to design XML Schemas for various port formality documents26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 31
  • 32. Dangerous Goods Declaration with ebXMLShippingAgents Paper submission 1 W eb su Marine bm 2 iss Dept io n Internet Hermes XML submission Hermes MSH 3 ebXML Message Service MSH 26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML over HTTP on VPN 32
  • 33. XML Schema Design andManagement Guide For HKSARG to implement e-government joined-up services – enhance data interoperability Systematic modelling methodology for designing reusable XML Schemas – facilitates design of consistent, quality and reusable schemas – consolidated international best practices, e.g. CCTS, UBL Flexible management framework for standardizing Common Schemas, e.g. HKID Number, Person Name, Postal Address – minimizes repetitive data alignment efforts by standardizing schemas for commonly used data elements Under public consultation – http://www.itsd.gov.hk/itsd/english/infra/eif.htm Pilot project: HK Observatory plans to broadcast weather information in XML through Web Services/HTTP26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 33
  • 34. Weather Information in XML/WS26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 34
  • 35. Digital Trade andTransportation Network A neutral, high-tech, and value-added e-logistics platform – facilitate information flow & service integration – pearl River Delta (PRD), regionally & globally – based on open-standards, e.g. XML / ebXML – SME is an important focus – releases 1 and 2 completed in 12-15 months Return on investment – estimated investment: HK$3B over 17 years – estimated benefit: HK$11B over 17 years http://www.logisticshk.gov.hk26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 35
  • 36. Proposed DTTN Architecture26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 36
  • 37. Open-Source Software(OSS) Development Conditions to advance global e-commerce development – high interoperability and reliability, low cost – therefore, open standards and open-source software HK is the world champion in ebXML OSS FreebXML.org to promote the development and adoption of open-source technologies for e-commerce – international collaboration: HKU (HK), Cyclone (US), ECOM (Japan), Kasetart U. (Thailand), KIEC (Korea), SigmaLogica (US), Sterling Commerce (US), Sun (US), Sybase (US) Our vision: FreebXML – the “Linux” and “Apache” in the e- commerce development26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 37
  • 38. 26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 38
  • 39. Global Penetration ofMade-in-HK OSS Many serious users in Asia and Europe!26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 39
  • 40. About CECID Center For E-Commerce Infrastructure Development Technology focus: XML and Web Services HKU R&D Center (15+ full-time staff) Primarily funded by Innovation and Technology Fund – establishment of ebXML infrastructure in HK – business process and information interoperability platform To enhance HK’s competitiveness in e-commerce development – technology creation and transfer for the community – provision of R&D and training services to businesses and the government (R&D outsourcing) – participation of international standardization initiatives26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 40
  • 41. Our R&D Strategy R&D R&D Pilot Production Products Projects Deployments HK Lead Projects / SIs End International Collaborations Users26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 41
  • 42. When Should I Use XML? When you need a buzzword in your resume :-)26 August 2003 HKCS XMLSG Speakers Meeting - Mythical XML 42
  • 43. Thank YouQ&AEmail: ytlee@cecid.hku.hkURL: www.cecid.hku.hk