Session 2: Markup Language Technologies
Total Page:16
File Type:pdf, Size:1020Kb
XML for Java Developers G22.3033-002 Session 2 - Main Theme Markup Language Technologies (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda Summary of Previous Session / Review New Syllabus XML Applications vs. Applications of XML!? History and Current State of XML Standards Advanced Applications of XML XML’s eXtensible Style Language (XSL) Character Encodings and Text Processing XML and DBMSs Course Approach ... XML Application Development XML References and Class Project Readings Assignment #1a (due today - reminder?) 2 Assignment #1b (due next week) 1 Summary of Previous Session XML Generics Course Logistics, Structure and Objectives History of Meta-Markup Languages XML Applications: Markup Languages XML Information Modeling Applications XML-Based Architectures XML and Java XML Development Tools (XML, DTD and Schema Editors) Summary Class Project Readings Assignment #1a 3 Old History Formatting Markups Rendition notations (e.g., LaTeX, TeX, RTF, MIF) Compatible with standard text editors Processed into presentations (printout, or electronic display) WYSIWYG What You See Is “ALL” You Get Meta-Markup Language GML (Goldfarb, Mosher, Lorie - IBM 1969) Generalized (i.e., indep. of systems, devices, applications) Markups (i.e., information related to struct. & content Language (i.e., methodology with formal syntax) Validation capabilities (1974) 4 2 SGML SGML (1978 - 10/15/86) Used by DoD for Continuous Acquisition and Lifecycle Support (CALS) http://www.oasis-open.org/cover/general.html SGML DTD or Schema <!DOCTYPE tutorials [ <!ELEMENT tutorials – (tutorial+)> <!ELEMENT tutorial – (title, intro, chap+)> <!ELEMENT title – O (#PCDATA)> <!ELEMENT intro – O (para+)> <!ELEMENT chap – O (title, para+)> <!ELEMENT para – O (#PCDATA)> ]> 5 SGML Markup <tutorials> <tutorial> <title>XML TUTORIAL <intro> <para>Required first paragraph of intro. <para>Optional second paragraph of intro. </intro> <chap> <title>CHAPTER 1 <para>Required first paragraph of first chapter. <chap> <title>CHAPTER 2 <para>Required first paragraph of optional 2nd chapter. </tutorial </tutorials> 6 3 W3C and HTML Tim Berners-Lee (CERN, 1989) W3 Hypertext System W3 uses HTML Founder of W3C in 1994 HTML Based on SGML, no DTD support) W3C HTML (http://www.w3.org/TR/html401/) CSS + weakly extensible HTML XML XHTML (http://www.w3.org/TR/xhtml1) 7 XML DTD <!DOCTYPE TUTORIALS [ <!ELEMENT tutorials (tutorial+)> <!ELEMENT tutorial (title, intro, chap+)> <!ELEMENT title (#PCDATA)> <!ELEMENT intro (para+)> <!ELEMENT chap (title, para+)> <!ELEMENT para (#PCDATA)> ]> XML is different from SGML Names are case sensitive Non empty elements must have a start and end tag DTD or Schema not required 8 4 Current State of XML Standards http://www.w3.org/XML, www.w3.org/XML/Activity.html, www.w3schools.com/xml eXtensible Markup Language (XML) 1.0 (2nd Edition) - 10/06/00) Namespaces in XML - 01/14/99 URIs: http://www.w3.org/Addressing/ XML Schema Part 0: Primer - 05/02/01 XML Schema Part 1: Structures - 05/02/01 XML Schema Part 2: Datatypes - 05/02/01 XML Path Language (XPath) Version 1.0 - 11/16/99 Working Draft of Version 2 - 05/02/03 Associating Stylesheets with XML Documents - 06/29/99 Use “xml:stylesheet” element in the XML document prolog XSL Transformations (XSLT) Version 1.0 - 11/16/99 Working Draft of Version 2 -05/02/03 9 Extensible Stylesheet Language (XSL) Version 2.0 – 10/15/01 Current State of XML Standards (continued) Canonical XML Version 1.0 - 03/15/01 Document Object Model (DOM) Level 2 - 11/13/00 Core, Views, Events, Style, Traversal & Range Web Content Accessibility Guidelines 1.0 - 05/05/99 Resource Description Framework (RDF) - 02/22/99 See http://www.w3.org/TR/ for Additional Specifications Core, XSL, Query, Linking, Schema Microsoft Validator: http://msdn.microsoft.com/downloads/samples/Internet/xml/xml_validator/sample.asp W3C Schema Validator (3/30/03) http://www.w3.org/2001/03/webdata/xsv 10 5 Advanced Applications of XML Ancestors: SGML with Annex K, HyTime, DSSS Alternatives: HTML 4.01, CSS HTML-Based XHTML 1.0, XForms 1.0 POP-Based e.g., XHTML, CML, MathML, SMIL, SVG, P3P, RDF, WML MOM-Based e.g., ebXML, RosettaNet, cXML, fpML, FIXML Web Services-Based Protocols (SOAP, WSDL, UDDI) 11 Services & Facilities (XAML – Transaction Authority ML) Logical Structure of XML Documents: Namespaces 1.0 • Namespaces: provides a simple method to qualify element and attribute names used in XML documents by associating them with namespaces identified by URIs – Example: <price> is borrowed from the “edi” schema <?xml version=“1.0”?> <order:x xmlns:order=‘http://ecommerce.org/order’> xmlns:edi=‘http://ecommerce.org/edi’> <edi:price>14.95</edi:price> </order:x> • See http://www.w3.org/TR/REC-xml-names/ 12 6 eXtensible Style Language (XSL) “Descendant” of SGML’s DSSSL & DSSSL-O CSS 1, 2, 3 … http://www.w3.org/Style/CSS/ XSLT (tree transformation) XPath (accessing, pointing to, and matching) XSL-FO (formatting objects) XSLT Processors Stylus Studio XSL development environment IBM XSL Editor Saxon and Xalan XSLT processors XSL-FO Processors Antenna House fop 13 XSL Processing http://www.w3.org/Style/XSL/ Processing Alternatives: HTML + CSS -> Presentation XML + CSS -> Presentation XML + XSLT -> XSL-FO -> Presentation XML + XSLT -> XML/HTML + CSS -> Presentation Client or Server Processing ? See Session 2 handout on IE5+’s implementation Examples See Session 2 Sub-Topic 1 Presentation: Beginning XML See Session 2 handouts on XSL Tree Transformation Language See Session 2 handout on Cascading Stylesheets 14 See Session 2 handout on Styling Documents Using XSL 7 Character Encodings & Text Processing ASCII, ISO 8859, and Unicode http://www.bbsinc.com/iso8859.html http://www.oasis-open.org/cover/unicode-xml.html www.unicode.org http://www.oasis-open.org/cover/unicode-xml.html http://home.att.net/~jameskass • Using Unicode characters in XML/HTML – U+ (4 digit min) hex number (e.g., "U+1234”) – Specify as: "ሴ" or "􏿽". White space processing ?! (wanted vs. unwanted) 15 XML & DBMSs Comparison Both separate data from rendition/presentation info Similar languages DBMSs: Forms and Reporting, DDL, DQL, DCL XML: XSL, XQL, and processing instructions No DML in XML XML is paired with a scripting or programming language Validation capabilities DBMSs: datatyping, relationship constraints XML: data type validity and semantic consistency checks XML can handle data too complex for some databases XML interchangeable form of data vs. multidatabases 16 8 Course Approach ... IBM XML Certification Test 140 IBM Certified Developer – XML and Related Technologies http://www-4.ibm.com/software/ad/certify/obj140.html (old) http://www-1.ibm.com/certify/tests/obj141.shtml (latest) Proficiency Objectives – Architecture Implications on XML Design – Information Modeling – XML Processing – XML Rendering –XML Query – Implementation Testing and Tuning 17 XML Application Development Applications of XML: Markup Languages XML Applications Using Core XML Technologies POP (Java is “optional”) Web Content Programming Web Application Development Web-Enabled Enterprise Application Development MOM EDI v.s. IEC/B2B EAI Applications e.g., ERP, SCM, CRM integration B2Bi, BPM, LE, and EII Applications Application Configuration Architectural Patterns requiring new XML protocols SOAs, P2P, Grid Computing, Brick by Brick Computing, etc. 18 9 XML POP Application Development Java “Independent” Component Models JSP Custom Tags XML/XSLT XML/Servlet Frameworks (e.g., Cocoon) XML/Servlet Filters XML/JavaScript XML Data Bindings Java Intensive Component Models JSP/Java JSP/JavaBeans Applets/Java Web Start Servlets Java Server Faces Java Applications (Including Thick Clients) 19 XML MOM Application Development Java “Independent” Component Models Scripting Languages Non J2EE Platforms (e.g., CORBA 3 & .Net) and PLs Web Services Platforms Sun Open Net Environment (ONE) HP NetAction Oracle Dynamic Services IBM WebSphere Platform Microsoft .NET Java Intensive Component Models EJBs JSP/JavaBeans Applets/Java Web Start Servlets Java Applications 20 10 XML References Information – www.learnthenet.com/english/index.html – http://www.xml.com – http://www.xml.org – http://www.xmlu.com – http://www.ucc.ie/xml – http://www.oasis-open.org/cover – http://msdn.microsoft.com/xml – http://xml.about.com Software – http://xml.apache.org – http://www.alphaworks.ibm.com/ – http://www.microsoft.com/xml – http://technet.oracle.com/tech/xml – http://java.sun.com/xml – http://www.xmlsoftware.com – http://www.xmlcenter.com/tools/ 21 Class Project Project Description The project will consist of providing custom XML-based services to support the various aspects of your own selected portable application. The application can be targeted to end-users (B2C), businesses (B2B), developers (toolkit). As an example, you could implement and XML- based training studio supporting VoiceXML, and application-sharing capabilities. Sample applications used in the past fell in the category of “multi- channel online community platforms”, and included applications such as “community-based shopping”. In that context, examples of useful XML-based services to support these platforms may include synchronized multimedia presentation viewing, and “offline” chat capabilities. A sample specification of the