XML and Java XML Parsing Program for Today Extensible Markup

Total Page:16

File Type:pdf, Size:1020Kb

XML and Java XML Parsing Program for Today Extensible Markup 11/8/10 Program for today • Introduc?on to XML • Parsing XML XML and Java XML Parsing • Wri?ng XML ICW 2010 Lecture 11 Marco Cova Internet Compu?ng Workshop 2 Extensible Markup Language (XML) Extensible Markup Language (XML) • We know how to store data on the server • How can we send todo – Rela?on database, SQL, and JDBC items from users to • We know how to present data to users server? – HTML, CSS, and JavaScript Alice’s todos – Plain text? • We know how to send data over the network – HTML? – Sockets • It would be easy if we had – HTTP tags to describe the items • We’ll see how you can handle user requests and send back Bob’s todos Todo server we exchange (todos, in appropriate responses over HTTP this case) – Servlets and JSP (next on!) • XML allows to do that • What if data has to be processed by another soUware – Feeds: RSS, ATOM instead of being displayed to a human user? – RPC: SOAP Charlie’s todos Marco Cova Internet Compu?ng Workshop 3 Marco Cova Internet Compu?ng Workshop 4 Example: RSS Well-formed, valid XML <?xml version="1.0" encoding="UTF-8"?> • Well-formed document <rss version="2.0”> <channel> – Starts with prolog, e.g., <?tle> &#187; School News</?tle> <?xml version="1.0" encoding="UTF-8”?> <link>hkp://www.cs.bham.ac.uk/sys/news/content</link> <descripon>School of Computer Science, The University of Birmingham</descripon> – Has one root element, e.g., <pubDate>Tue, 21 Sep 2010 12:08:34 +0000</pubDate> <rss version="2.0”> <generator>hkp://wordpress.org/?v=2.7.1</generator> – <language>en</language> Elements nest properly <item> • Valid document <?tle>Computer Science student named top 100 graduate in the UK</?tle> <link>hkp://www.cs.bham.ac.uk/sys/news/content/2010/09/02/computer-science-student- – Well-formed named-top-100-graduate-in-the-uk/</link> <pubDate>Thu, 02 Sep 2010 16:51:26 +0100</pubDate> – Has an associated document type declara?on <category><![CDATA[School News]]></category> – Complies with the constraints of the document type <descripon><![CDATA[Computer Science graduate…]></descripon> </item> declara?on </channel> </rss> Marco Cova Internet Compu?ng Workshop 5 Marco Cova Internet Compu?ng Workshop 6 1 11/8/10 Reading XML documents Tree-based parsing: DOM Parsing approaches: XML file Java DOM API DOM • Tree-based: object representa?on of XML document is stored in memory (as a tree) Document BuilderFactory – +: easy to manipulate document <todo> – -: memory requirement <?tle>slides</?tle> <due>2010-09-30</due> Document • Event-based: as parts of XML document are read <done>y</done> Builder events are generated (e.g., element started) <todo> – +: memory requirement – -: cannot easily manipulate document Marco Cova Internet Compu?ng Workshop 7 Marco Cova Internet Compu?ng Workshop 8 Tree-based parsing: DOM DOM use // instantiate the factory DocumentBuilderFactory dbf = Note: Node types Tree naviga1on DocumentBuilderFactory.newInstance(); • By default, parser is not • Ar • Node.getChildNodes // instantiate the document builder valida?ng • Comments • Node.getFirstChild DocumentBuilder db = – See dbf.setValida?ng() • Document dbf.newDocumentBuilder(); • Node.getLastChild • • Element // parse the file Various op?ons to • Document.getDocumentEle Document doc = db.parse(new File tweak the generated • Text (“todo.xml”)); ment tree, e.g.: • Less common: CDATASecon, CharacterData, • getElementsByTagName – Whitespace DocumentFragment, – CDATA coalescing DocumentType, En?ty, – comments En?tyReference, Nota?on, ProcessingInstruc?on Marco Cova Internet Compu?ng Workshop 9 Marco Cova Internet Compu?ng Workshop 10 Event-based parsing SAX • Parser produces no?fica?ons in XML file Java DOM API EventHandler correspondence of certain events (e.g., element started, element closed) SaxParser • 2 approaches: Factory – Push-based <todo> todo el. start <?tle>slides</?tle> • Once document read, parser must handle all events <due>2010-09-30</due> SaxParser ?tle el. start <done>y</done> • Simple API for XML (SAX) <todo> – Pull-based todo el. end • Parser controls the parsing (start, pause, resume) • Streaming API for XML (StAX) Marco Cova Internet Compu?ng Workshop 11 Marco Cova Internet Compu?ng Workshop 12 2 11/8/10 SAX StAX Parse setup Event handling XML file Java DOM API Program // instan?ate the factory class MyEventHandler SAXParserFactory factory = extends DefaultHandler { SAXParserFactory.newInstance(); SaxParser // instan?ate the parser // invoked when close tag found Factory SAXParser sp = factory.newSAXParser(); public void endElement(String uri, next // parse the document String localName, String qName); sp.parse(new File(“todo.xml”), <todo> new MyEventHandler()); // invoked when start tag found <?tle>slides</?tle> public void startElement(String <due>2010-09-30</due> SaxParser uri, String localName, String <done>y</done> todo el. start qName); <todo> // invoked when text element found public void characters(char[] ch, int start, int length) } Marco Cova Internet Compu?ng Workshop 13 Marco Cova Internet Compu?ng Workshop 14 StAX Modifying XML documents Parse setup Event handling • Add element // instantiate the factory while (reader.hasNext()) { – Document.createElement() XMLInputFactory factory = // get event type XMLInputFactory.newFactory(); int et = reader.getEventType() – Element.appendChild // instantiate the reader XMLStreamReader reader = // handle START_ELEMENT • Add akributes factory.createXMLStreamReader if (et == START_ELEMENT) { (new FileReader(“todo.xml”)); – Element.setAkribute(akr, value) } // handle other event types • Remove element … – Element.removeChild // get next event reader.next(); • Remove akribute } – Element.removeAribute Marco Cova Internet Compu?ng Workshop 15 Marco Cova Internet Compu?ng Workshop 16 Wri?ng XML documents Wri?ng XML documents – cont’d We could simply do: But: • A beker approach: serialize a DOM object out = System.out; • It’s hard to read and • Two techniques maintain out.println(“<?xml version=\"1.0\" – Visit the DOM tree and produce output depending encoding=\"UTF-8\"?>”); • out.println(“<rss version=\"2.0\”>”); It’s easy to make on current element … mistakes for (Item e : items) { – Leverage the transforma?on mechanism out.println(“<item>”); – Can you spot the error? out.println(“ <tle>” + e.?tle + “</ (java.xml.transform) to apply an iden?ty ?tle>”); transforma?on that saves its result in a file (see .. } code example) out.write(“</rss>”); Marco Cova Internet Compu?ng Workshop 17 Marco Cova Internet Compu?ng Workshop 18 3 11/8/10 Wri?ng XML documents – cont’d Charset, character encodings writeNode(doc.getDocumentElement()); void writeElement(Element e, FileWriter fout) { • Character set: set of String n = e.getNodeName(); characters void writeNode(Node n, FileWriter fout) { // open tag • Coded character set: if (n instanceof Element) fout.write(“<“ + n + “>”); writeElement((Element)n, fout); character set in which else if (n instanceof Text) // handle children every leker is mapped writeText((Text) n, fout); NodeList c = e.getChildNodes(); … for (int i = 0; i < c.getLength(); i++) { to a number (code } writeNode(c.item(i), fout); point) } • Character encoding: // close tag // write a text node fout.write(“</“ + n + “>”); specify how coded void writeText(Text t, } FileWriter fout) { characters are mapped fout(t.nodeValue); } to bytes Courtesy of hkp://www.w3.org/Interna?onal/ar?cles/defini?ons-characters/ Marco Cova Internet Compu?ng Workshop 19 Marco Cova Internet Compu?ng Workshop 20 Namespaces Namespaces – cont’d • Certain elements and akributes define a Solu?on: XML namespace • Elements are specified (“fully qualified”) by namespace vocabulary that may be reused in mul?ple prefix and name documents dc:?tle – E.g., the “Dublin Core Metadata Element Set” defines • Namespace prefix is associated to a namespace name 15 general proper?es, such as creator, :tle, etc. xmlns:dc=hkp://purl.org/dc/elements/1.1/ • Document declares the bindings it will use: • XML documents may wish to combine several <rss version="2.0” vocabularies xmlns:dc=hkp://purl.org/dc/elements/1.1/ xmlns:atom=hp://www.w3.org/2005/Atom • Issue: collisions • When using an element, use its fully qualified name: – E.g., both Dublin and Atom define a :tle element <dc:?tle>Title</dc:?tle> Marco Cova Internet Compu?ng Workshop 21 Marco Cova Internet Compu?ng Workshop 22 Escaping References • What if we want to write a todo item such as <todo> • Extensible Markup Language (XML) 1.0, <?tle>add new field <category></?tle> hkp://www.w3.org/TR/xml/ </todo> • <category> should be interpreted as simple text, but parser • Introducing Character Sets and Encodings, will consider it to be a tag and will raise an error (Why?) hkp://www.w3.org/Interna?onal/ar?cles/ • Soluon: CDATA secon – Forces parser to consider its content as text (not markup) defini?ons-characters/ – <![CDATA[ … ]]> <todo> <?tle>add new field <![CDATA[<category>]]></?tle> </todo> Marco Cova Internet Compu?ng Workshop 23 Marco Cova Internet Compu?ng Workshop 24 4 .
Recommended publications
  • JAXB Release Documentation JAXB Release Documentation Table of Contents
    JAXB Release Documentation JAXB Release Documentation Table of Contents Overview .......................................................................................................................... 1 1. Documentation ....................................................................................................... 1 2. Software Licenses ................................................................................................... 1 3. Sample Apps .......................................................................................................... 2 3.1. Using the Runtime Binding Framework ............................................................ 2 Release Notes .................................................................................................................... 6 1. Java™ 2 Platform, Standard Edition (J2SE™) Requirements .......................................... 7 2. Identifying the JAR Files ......................................................................................... 7 3. Locating the Normative Binding Schema .................................................................... 7 4. Changelog ............................................................................................................. 7 4.1. Changes between 2.3.0.1 and 2.4.0 .................................................................. 7 4.2. Changes between 2.3.0 and 2.3.0.1 .................................................................. 7 4.3. Changes between 2.2.11 and 2.3.0 ..................................................................
    [Show full text]
  • Fun Factor: Coding with Xquery a Conversation with Jason Hunter by Ivan Pedruzzi, Senior Product Architect for Stylus Studio
    Fun Factor: Coding With XQuery A Conversation with Jason Hunter by Ivan Pedruzzi, Senior Product Architect for Stylus Studio Jason Hunter is the author of Java Servlet Programming and co-author of Java Enterprise Best Practices (both O'Reilly Media), an original contributor to Apache Tomcat, and a member of the expert groups responsible for Servlet, JSP, JAXP, and XQJ (XQuery API for Java) development. Jason is an Apache Member, and as Apache's representative to the Java Community Process Executive Committee he established a landmark agreement for open source Java. He co-created the open source JDOM library to enable optimized Java and XML integration. More recently, Jason's work has focused on XQuery technologies. In addition to helping on XQJ, he co-created BumbleBee, an XQuery test harness, and started XQuery.com, a popular XQuery development portal. Jason presently works as a Senior Engineer with Mark Logic, maker of Content Interaction Server, an XQuery-enabled database for content. Jason is interviewed by Ivan Pedruzzi, Senior Product Architect for Stylus Studio. Stylus Studio is the leading XML IDE for XML data integration, featuring advanced support for XQuery development, including XQuery editing, mapping, debugging and performance profiling. Ivan Pedruzzi: Hi, Jason. Thanks for taking the time to XQuery behind a J2EE server (I have a JSP tag library talk with The Stylus Scoop today. Most of our readers for this) but I’ve found it easier to simply put XQuery are familiar with your past work on Java Servlets; but directly on the web. What you do is put .xqy files on the could you tell us what was behind your more recent server that are XQuery scripts to produce XHTML interest and work in XQuery technologies? pages.
    [Show full text]
  • XML for Java Developers G22.3033-002 Course Roadmap
    XML for Java Developers G22.3033-002 Session 1 - Main Theme Markup Language Technologies (Part I) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Course Roadmap Consider the Spectrum of Applications Architectures Distributed vs. Decentralized Apps + Thick vs. Thin Clients J2EE for eCommerce vs. J2EE/Web Services, JXTA, etc. Learn Specific XML/Java “Patterns” Used for Data/Content Presentation, Data Exchange, and Application Configuration Cover XML/Java Technologies According to their Use in the Various Phases of the Application Development Lifecycle (i.e., Discovery, Design, Development, Deployment, Administration) e.g., Modeling, Configuration Management, Processing, Rendering, Querying, Secure Messaging, etc. Develop XML Applications as Assemblies of Reusable XML- Based Services (Applications of XML + Java Applications) 2 1 Agenda 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 Summary Class Project Readings Assignment #1a 3 Part I Introduction 4 2 XML Generics XML means eXtensible Markup Language XML expresses the structure of information (i.e., document content) separately from its presentation XSL style sheets are used to convert documents to a presentation format that can be processed by a target presentation device (e.g., HTML in the case of legacy browsers) Need a
    [Show full text]
  • XML: Looking at the Forest Instead of the Trees Guy Lapalme Professor Département D©Informatique Et De Recherche Opérationnelle Université De Montréal
    XML: Looking at the Forest Instead of the Trees Guy Lapalme Professor Département d©informatique et de recherche opérationnelle Université de Montréal C.P. 6128, Succ. Centre-Ville Montréal, Québec Canada H3C 3J7 [email protected] http://www.iro.umontreal.ca/~lapalme/ForestInsteadOfTheTrees/ Publication date April 14, 2019 XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/ XML: Looking at the Forest Instead of the Trees Guy Lapalme Professor Département d©informatique et de recherche opérationnelle Université de Montréal C.P. 6128, Succ. Centre-Ville Montréal, Québec Canada H3C 3J7 [email protected] http://www.iro.umontreal.ca/~lapalme/ForestInsteadOfTheTrees/ Publication date April 14, 2019 Abstract This tutorial gives a high-level overview of the main principles underlying some XML technologies: DTD, XML Schema, RELAX NG, Schematron, XPath, XSL stylesheets, Formatting Objects, DOM, SAX and StAX models of processing. They are presented from the point of view of the computer scientist, without the hype too often associated with them. We do not give a detailed description but we focus on the relations between the main ideas of XML and other computer language technologies. A single compact pretty-print example is used throughout the text to illustrate the processing of an XML structure with XML technologies or with Java programs. We also show how to create an XML document by programming in Java, in Ruby, in Python, in PHP, in E4X (Ecmascript for XML) and in Swift. The source code of the example XML ®les and the programs are available either at the companion web site of this document or by clicking on the ®le name within brackets at the start of the caption of each example.
    [Show full text]
  • Testing XSLT
    Testing XSLT Tony Graham Menteith Consulting Ltd 13 Kelly's Bay Beach Skerries, Co Dublin Ireland [email protected] http://www.menteithconsulting.com Version 1.3 – XML Prague 2009 – 21 March 2009 © 2007–2009 Menteith Consulting Ltd Testing XSLT Testing XSLT Introductions 5 XSLT 5 Testing Source 5 Testing Result 6 Testing Source–Result 6 Testing the Stylesheet 7 Problem Scenarios 16 Errors That Aren't Caught By Other Tests 17 Resources 18 © 2007–2009 Menteith Consulting Ltd 3 Menteith Consulting 4 © 2007–2009 Menteith Consulting Ltd Testing XSLT Testing XSLT 1 • Introduction • Testing Source • Testing Result • Testing Source–Result • Testing the Stylesheet Introductions Who am I? 2 • Tony Graham of Menteith Consulting • XML and XSL/XSLT consultant • Based in Dublin, Ireland • Clients in Ireland, USA, France, UK • Doing XSLT since 1998 • Working with both XSLT 1.0 and XSLT 2.0 XSLT 3 Transforms source tree into result tree by associating patterns with templates XSLT / Stylesheet Source Result Tree Tree / / XSLT Processor © 2007–2009 Menteith Consulting Ltd 5 Menteith Consulting 4 Testing Source • Good if you can do it • May be well-formed or very loose schema • May be constraints that aren't easily checked 5 Testing Result • Good if you can do it • May be well-formed or very loose schema • May be constraints that aren't easily checked, e.g., XSL FO • If HTML, use HTML testing tools, e.g., WebTest • Harder to verify text output 6 Testing Source–Result 6 © 2007–2009 Menteith Consulting Ltd Testing XSLT XSLV Static Validation Tool
    [Show full text]
  • JSR-000206 Java™API for XML Processing (“Specification”)
    JSR-000206 Java™API for XML Processing (“Specification”) Version: 1.5 July 16, 2013 Maintenance Lead: Joe Wang Oracle Corporation Feedback: Please send comments to [email protected] Oracle Corporation 500 Oracle Parkway Redwood Shores, CA 94065 USA ORACLE AMERICA, INC. IS WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS AGREEMENT. PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY IT, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE. Specification: <JSR-206 Java™API for XML Processing ("Specification") Version: 1.5 Status: Final Release Specification Lead: Oracle America, Inc. ("Specification Lead") Release: March 2013 Copyright 2013 Oracle America, Inc. All rights reserved. LIMITED LICENSE GRANTS 1. License for Evaluation Purposes. Specification Lead hereby grants you a fully-paid, non-exclusive, non- transferable, worldwide, limited license (without the right to sublicense), under Specification Lead's applicable intellectual property rights to view, download, use and reproduce the Specification only for the purpose of internal evaluation. This includes (i) developing applications intended to run on an implementation of the Specification, provided that such applications do not themselves implement any portion(s) of the Specification, and (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification.
    [Show full text]
  • An Empirical Analysis of XML Parsing Using Various Operating Systems
    International Journal of Engineering and Applied Sciences (IJEAS) ISSN: 2394-3661, Volume-2, Issue-2, February 2015 An Empirical Analysis of XML parsing using various operating systems. Amitesh Saxena, Dr. Snehlata Kothari used everywhere in software. An XML Parser is a parser that Abstract— As the use of internet technologies are widely is designed to read XML and create a way for programs to use increasing, the XML markup language attains a remarkable XML. There are different types, and each has its advantages. importance due to its language neutrality and independency in Unless a program simply and blindly copies the whole using data exchange and data transfer through web XML file as a unit, every program must implement or call on environment mechanism. For improving the processing an XML parser. performance of XML parser, it is necessary to find out a mechanism, in which we get minimum processing time while B. DOM (Document Object Model) parsing of XML documents. In this paper, XML documents are being experimentally It supports navigating and modifying XML documents tested using various operating systems to determine, whether an - Hierarchical tree representation of document operating system effect the processing time of XML parsing. - Tree follows standard API - Creating tree is vendor specific Index Terms— XML Parser, DOM Parser, Operating DOM is a language-neutral specification system. - Binding exist for Java, C++, CORBA, JavaScript, C# - can switch to other language. I. INTRODUCTION The Document Object Model (DOM) is In Present world, mega information are sharing and an interface-oriented application programming interface that transmitting, In this XML plays a very significant role as a allows for navigation of the entire document as if it were a tree worldwide design for data interchange.
    [Show full text]
  • Xquery 3.0 69 Higher-Order Functions 75 Full-Text 82 Full-Text/Japanese 85 Xquery Update 87 Java Bindings 91 Packaging 92 Xquery Errors 95 Serialization 105
    BaseX Documentation Version 7.2 PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sat, 24 Mar 2012 17:30:37 UTC Contents Articles Main Page 1 Getting Started 3 Getting Started 3 Startup 4 Startup Options 6 Start Scripts 13 User Interfaces 16 Graphical User Interface 16 Shortcuts 20 Database Server 23 Standalone Mode 26 Web Application 27 General Info 30 Databases 30 Binary Data 32 Parsers 33 Commands 37 Options 50 Integration 64 Integrating oXygen 64 Integrating Eclipse 66 Query Features 68 Querying 68 XQuery 3.0 69 Higher-Order Functions 75 Full-Text 82 Full-Text/Japanese 85 XQuery Update 87 Java Bindings 91 Packaging 92 XQuery Errors 95 Serialization 105 XQuery Modules 108 Cryptographic Module 108 Database Module 113 File Module 120 Full-Text Module 125 HTTP Module 128 Higher-Order Functions Module 131 Index Module 133 JSON Module 135 Map Module 140 Math Module 144 Repository Module 148 SQL Module 149 Utility Module 153 XSLT Module 157 ZIP Module 160 ZIP Module: Word Documents 162 Developing 164 Developing 164 Integrate 165 Git 166 Maven 172 Releases 174 Translations 175 HTTP Services 176 REST 176 REST: POST Schema 184 RESTXQ 185 WebDAV 189 WebDAV: Windows 7 190 WebDAV: Windows XP 192 WebDAV: Mac OSX 195 WebDAV: GNOME 197 WebDAV: KDE 199 Client APIs 201 Clients 201 Standard Mode 202 Query Mode 203 PHP Example 205 Server Protocol 206 Server Protocol: Types 210 Java Examples 212 Advanced User's Guide 214 Advanced User's Guide 214 Configuration 215 Catalog Resolver 216 Statistics 218 Backups 222 User Management 222 Transaction Management 224 Logging 225 Events 226 Indexes 228 Execution Plan 230 References Article Sources and Contributors 231 Image Sources, Licenses and Contributors 233 Article Licenses License 234 Main Page 1 Main Page Welcome to the documentation of BaseX! BaseX [1] is both a light-weight, high-performance and scalable XML Database and an XPath/XQuery Processor with full support for the W3C Update and Full Text extensions.
    [Show full text]
  • Java API for XML Processing (JAXP)
    Java API for XML Processing (JAXP) • API that provides an abstraction layer to XML parser implementations (specifically implementations of DOM and SAX), and applications that process Extensible Stylesheet Language Transformations (XSLT) • JAXP is is a layer above the parser APIs that makes it easier to perform some vendor-specific tasks in a vendor-neutral fashion. JAXP employs the Abstract Factory design pattern to provide a plugability layer, which allows you to plug in an implementation of DOM or SAX, or an application that processes XSLT • The primary classes of the JAXP plugability layer are javax.xml.parsers.DocumentBuilderFactory, javax.xml.parsers.SAXParserFactory, and javax.xml.transform.TransformerFactory. • Classes are abstract so you must ask the specific factory to create an instance of itself, and then use that instance to create a javax.xml.parsers.DocumentBuilder, javax.xml.parsers.SAXParser, or javax.xml.transform.Transformer, respectively. • DocumentBuilder abstracts the underlying DOM parser implementation, SAXParser the SAX parser implementation, and Transformer the underlying XSLT processor. DocumentBuilder, SAXParser, and Transformer are also abstract classes, so instances of them can only be obtained through their respective factory. JAXP Example - 1 import java.io.*; import javax.xml.*; import org.w3c.dom.Document; import org.xml.sax.SAXException; import javawebbook.sax.ContentHandlerExample; public class JAXPTest { public static void main(String[] args) throws Exception { File xmlFile = new File(args[0]); File
    [Show full text]
  • 1 Agenda Summary of Previous Session
    XML for Java Developers G22.3033-002 Session 7 - Main Theme XML Information Rendering (Part I) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda n Summary of Previous Session n Extensible Stylesheet Language Transformation (XSL-T) n Extensible Stylesheet Language Formatting Object (XSL-FO) n XML and Document/Content Management n Assignment 4a+4b (due in two week) 2 Summary of Previous Session n Advanced XML Parser Technology n JDOM: Java-Centric API for XML n JAXP: Java API for XML Processing n Parsers comparison n Latest W3C APIs and Standards for Processing XML n XML Infoset, DOM Level 3, Canonical XML n XML Signatures, XBase, XInclude n XML Schema Adjuncts n Java-Based XML Data Processing Frameworks n Assignment 3a+3b (due next week) 3 1 XML-Based Rendering Development n XML Software Development Methodology n Language + Stepwise Process + Tools n Rational Unified Process (RUP) v.s. “XML Unified Process” n XML Application Development Infrastructure n Metadata Management (e.g., XMI) n XSLT, XPath XSL -FO APIs (JAXP, JAXB, JDOM, SAX, DOM) n XML Tools (e.g., XML Editors,Apache’s FOP, Antenna House’s XSL Formatter, HTML/CSS1/2/3, XHTML, XForms, WCAG n XML Applications Involved in the Rendering Phase: n Application(s) of XML n XML-based applications/services (markup language mediators) n MOM, POP, Other Services (e.g., persistence) 4 n Application Infrastructure Frameworks What is XSL? n XSL is a language for expressing stylesheets. It consists of two parts: n A language for transforming XML documents n A XML vocabulary for specifying formatting semantics n See http://www.w3.org/Style/XSL for the XSLT 1.0/XPath 1.0 Recs, the XSL-FO 1.0 candidate rec, and working drafts of XSLT 1.1/2.0 and XPath 2.0 n A XSL stylesheet specifies the presentation of a class of XML documents.
    [Show full text]
  • Xquery API for Java™ (XQJ) 1.0 Specification Version 0.9 (JSR 225 Public Draft Specification) May 21, 2007
    XQuery API for Java™ (XQJ) 1.0 Specification Version 0.9 (JSR 225 Public Draft Specification) May 21, 2007 Spec Lead: Jim Melton Oracle Editor: Marc Van Cappellen DataDirect Technologies This document is the Public Draft Specification of the XQuery API for Java™ (XQJ) 1.0. It describes the current state of the XQuery API for Java™ (XQJ), and is subject to possibly changes and should not be considered to be in any way final. Comments on this specification should be sent to [email protected]. Copyright © 2003, 2006, 2007, Oracle. All rights reserved. Java™ is a registered trademark of Sun Microsystems, Inc. http://www.sun.com JSR 225 Public Draft Specification – Version 0.9 SPECIFICATION LICENSE Oracle USA (the “Spec Lead”) for the XQuery API for Java specification (the “Specification”) hereby grant a perpetual, non-exclusive, worldwide, fully paid-up, royalty-free, irrevocable (except as explicitly set forth below) license to copy and display the Specification, in any medium without fee or royalty, provided that you include the following on ALL copies, or portions thereof, that you make: 1. A link or URL to the Specification at this location: __________. 2. The copyright notice as shown herein. In addition, to the extent that an implementation of the Specification would be considered a derivative work under applicable law requiring a license grant from the holder of the copyright in the Specification, the Spec Lead grants a copyright license solely for the purpose of making and/or distributing an implementation of the Specification that: (a) except for the RI code licensed from Oracle under the RI License, does not include or otherwise make any use of the RI; (b) fully implements the Specification including all of its required interfaces and functionality; (c) does not modify, subset, superset or otherwise extend those public class or interface declarations whose names begin with “java;” and (d) passes the TCK.
    [Show full text]
  • JAXP.Ps (Mpage)
    2.3 JAXP: Java API for XML Processing JAXP 1.1 How can applications use XML processors? Included in Java since JDK 1.4 – A Java -based answer: through JAXP An interface for “plugging -in ” and using XML – An overview of the JAXP interface processors in Java applications » What does it specify? – includes packages » What can be done with it? » org.xml.sax : SAX 2.0 » How do the JAXP components fit together? » org.w3c.dom: DOM Level 2 » javax.xml.parsers : [Partly based on tutorial “An Overview of the APIs ” at initialization and use of parsers http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/overview » javax.xml.transform : /3_apis.html, from which also some graphics are borrowed] initialization and use of transformers (XSLT processors) XPT 2006 XML APIs: JAXP 1 XPT 2006 XML APIs: JAXP 2 Later Versions JAXP: XML processor plugin (1) JAXP 1.2 (2002) adds property -strings for Vendor -independent method for selecting setting the language and source of a schema processor implementation at run time used for (non -DTD -based) validation – principally through system properties JAXP 1.3 included in JDK 5.0 (2005) javax.xml.parsers.SAXParserFactory javax.xml.parsers.DocumentBuilderFactory – more flexible validation (decoupled from parsing) javax.xml.transform.TransformerFactory – support for DOM3 and XPath – Set on command line (for example, to use Apache Xerces as the DOM implementation): We'll restrict to basic ideas from JAXP 1.1 java -Djavax.xml.parsers.DocumentBuilderFactory = org.apache.xerces.jaxp.DocumentBuilderFactoryImpl XPT
    [Show full text]