IBM Research © 2005 IBM Corporation XJ: Robust XML Processing in Java™ Mukund Raghavachari, Rajesh Bordawekar, Michael Burke, and Igor Peshansky IBM T.

Slides:



Advertisements
Similar presentations
Inside an XSLT Processor Michael Kay, ICL 19 May 2000.
Advertisements

Querying on the Web: XQuery, RDQL, SparQL Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology.
Lists and the Collection Interface Chapter 4. Chapter Objectives To become familiar with the List interface To understand how to write an array-based.
XML: Extensible Markup Language
UFCEKG-20-2 Data, Schemas & Applications Lecture 5 XML & PHP.
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University.
1 COS 425: Database and Information Management Systems XML and information exchange.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
XQuery – The W3C XML Query Language Jonathan Robie, Software AG Don Chamberlin, IBM Research Daniela Florescu, INRIA.
Storing and Querying Ordered XML Using a Relational Database System By Khang Nguyen Based on the paper of Igor Tatarinov and Statis Viglas.
Microsoft Office Open XML Formats Brian Jones Lead Program Manager Microsoft Corporation.
JAXB Java Architecture for XML Bindings. What is JAXB? JAXB defines the behavior of a standard set of tools and interfaces that automatically generate.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
XML Query Language Changki Kim July MSE. 2 2 Contents  Introduction  XQuery Data Model  XQuery Expression Types  Implementations of XQuery.
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
Indexing XML Data Stored in a Relational Database VLDB`2004 Shankar Pal, Istvan Cseri, Gideon Schaller, Oliver Seeliger, Leo Giakoumakis, Vasili Vasili.
.NET and XML (or XML in.NET) David Oguns Matt Harding.
4/20/2017.
Module 17 Storing XML Data in SQL Server® 2008 R2.
XML Fundementals XML vs.. HTML XML vs.. HTML XML Document (elements vs. attributes) XML Document (elements vs. attributes) XML and RDBMS XML and RDBMS.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
A Simplified Approach to Web Service Development Peter Kelly Paul Coddington Andrew Wendelborn.
Lecture 6 of Advanced Databases XML Schema, Querying & Transformation Instructor: Mr.Ahmed Al Astal.
Comparing XSLT and XQuery Michael Kay XTech 2005.
XML and its applications: 4. Processing XML using PHP.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
© 2006 IBM Corporation Jazz Foundation Deep Dive Agile Planning’s Scripting Tools.
XML BIS4430 – unit 10. XML Origins Extensible Markup Language (XML) 1998 Inspired by Standard Generalized Markup Language (SGML) and HTML. SGML defines.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation eXist Update Lecturer.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Lecture 22 XML querying. 2 Example 31.5 – XQuery FLWOR Expressions ‘=’ operator is a general comparison operator. XQuery also defines value comparison.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation.
Ontologies and Lexical Semantic Networks, Their Editing and Browsing Pavel Smrž and Martin Povolný Faculty of Informatics,
Declaratively Producing Data Mash-ups Sudarshan Murthy 1, David Maier 2 1 Applied Research, Wipro Technologies 2 Department of Computer Science, Portland.
DOM Programming The Document Object Model standardises  what an application can see of the XML data  how it can access it An XML structure is a tree.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
XML Grammar and Parser for WSOL Kruti Patel, Vladimir Tosic, Bernard Pagurek Network Management & Artificial Intelligence Lab Department of Systems & Computer.
The Semistructured-Data Model Programming Languages for XML Spring 2011 Instructor: Hassan Khosravi.
XML and Database.
Sept. 27, 2002 ISDB’02 Transforming XPath Queries for Bottom-Up Query Processing Yoshiharu Ishikawa Takaaki Nagai Hiroyuki Kitagawa University of Tsukuba.
1 Typing XQuery WANG Zhen (Selina) Something about the Internship Group Name: PROTHEO, Inria, France Research: Rewriting and strategies, Constraints,
INT-2: XQuery Levels the Data Integration Playing Field Carlo (Minollo) Innocenti DataDirect XML Technologies, Program Manager.
Martin Kruliš by Martin Kruliš (v1.1)1.
XJ: Facilitating XML Processing in Java Matthew Harren Mukund Raghavachari Oded Shmueli Michael Burke Rajesh Bordawekar Igor Pechtchanski Vivek Sarkar.
Grouping Robin Burke ECT 360. Outline Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method Generated ids Keys Moded Templates.
Lecture 23 XQuery 1.0 and XPath 2.0 Data Model. 2 Example 31.7 – User-Defined Function Function to return staff at a given branch. DEFINE FUNCTION staffAtBranch($bNo)
Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy draft-mahy-canmod-dsdl-01.
LINQ Language Integrated Query LINQ1. LINQ: Why and what? Problem Many data sources: Relational databases, XML, in-memory data structures, objects, etc.
Copyright 2002, Ronald Bourret, XML-DBMS Middleware for XML and databases Ronald Bourret O'Reilly Open.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
SEMI-STRUCTURED DATA (XML) 1. SEMI-STRUCTURED DATA ER, Relational, ODL data models are all based on schema Structure of data is rigid and known is advance.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
XML: Extensible Markup Language
Efficient Evaluation of XQuery over Streaming Data
Unit 4 Representing Web Data: XML
XML in Web Technologies
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Database Processing with XML
Chapter 7 Representing Web Data: XML
MSIS 655 Advanced Business Applications Programming
Querying XML XPath.
Data Model.
Querying XML XPath.
2/18/2019.
XML and its applications: 4. Processing XML using PHP
Presentation transcript:

IBM Research © 2005 IBM Corporation XJ: Robust XML Processing in Java™ Mukund Raghavachari, Rajesh Bordawekar, Michael Burke, and Igor Peshansky IBM T. J. Watson Research Center

IBM Research © 2005 IBM Corporation 2 XML is Pervasive Messagin g Legacy Database s Web Services Programming is tedious, error-prone, and inefficient

IBM Research © 2005 IBM Corporation 3 DOM  Verbose  No static schema type checking  Reflection-like programming style  Performance an issue Element recipe = new Element(“recipe"); Element ingredient = new Element(“ingredient"); recipe.appendChild(ingredient);

IBM Research © 2005 IBM Corporation 4 JAXB  Converts XML Schema types into Java classes –Java type system cannot express schema content models –Difference between attributes and elements –Ordering  Some static type checking  XPath evaluation by passing strings –No static type checking or optimization

IBM Research © 2005 IBM Corporation 5 XSLT and XQuery  Domain-specific languages for processing XML  Certain programming tasks may be complex  Integration with Java programs is awkward –Java programs must still pass and process XML data to these languages using runtime APIs: DOM XQJ

IBM Research © 2005 IBM Corporation 6 XJ Design Goals  Make XML a first-class construct in Java 1.Consistency with XML standards (Namespaces, XML Schema, XPath) 2.Minimal changes to Java 3.Efficiency 4.Support both schema and schema-less processing  XML processing applications are easier to write, more robust, and efficient

IBM Research © 2005 IBM Corporation 7 XJ Features  Language extensions –In-line XML construction –Integrated XPath –In-place XML updates –All of the above with or without XML Schema Import of XML Schemas  Efficient implementation –Native XPath compilation support  Eclipse plug-in –To be released soon

IBM Research © 2005 IBM Corporation 8 Sample XJ Program import com.amazon.devheavy.*; import com.amazon.devheavy.ProductInfo.Details; import myOutput.*; public Book checkReviews (ProductInfo pi, String title, String author, float goodRating) { Sequence bookSeq = pi[|.//Details[ProductName = $title] |]; for (XMLCursor iter = bookSeq.iterator(); iter.hasNext();) { Details book = iter.next(); if (!book[| [$author =.//Author] |].isEmpty()) { double discountMult = 0.5; if (!book[| [.//AvgCustomerRating > $goodRating] |].isEmpty() ) discountMult = 0.75; Book result = new Book( {book[| /Isbn |] } {book[| //Price |] * discountMult} ); return result; }}} Refer to schema declarations Inline XPath XML Construction

IBM Research © 2005 IBM Corporation 9 XPath Navigation context [| query |]  The primary means of navigating XML data  Semantics as defined by the XPath 1.0 standard ProductInfo p = ….; /* Generics for XML types */ Sequence items = p[| //Details[.//AvgCustomerRating > 3.5] |]; UsedPrice price1 = p [| /UsedPrice |]; String price2 = p [| /UsedPrice |]; /* Automatic unboxing as in Java 5*/ Compiler checks that XPath is well formed and valid according to the schema.

IBM Research © 2005 IBM Corporation 10 Construction of XML  Construction can be specified as: –Inline XML (can use xmlns and xsi:type) Can construct “untyped” XML as well –InputStream constructor int price = 54; Book b = new Book( C# Concisely Judith Bishop Nigel Horspool Addison-Wesley { price } ); XMLElement b = new XMLElement(

IBM Research © 2005 IBM Corporation 11 XML Updates  Value update – book[|./price|] = 100; or book[|./price|].updateValue(100);  Insertion (can operate on a sequence) – book.insertChild(author);  Deletion (can operate on a sequence) – author.detachNode();  Compound update – article.rename(“inproceedings”);

IBM Research © 2005 IBM Corporation 12 XJ Compiler and Runtime System xjc XJ Source + XML Schemas Eclipse JDT Java bytecode DOM xj JRE XML data XJ Runtime

IBM Research © 2005 IBM Corporation 13 Demo Details Based on the XMark and DBLP Benchmarks Demonstrates the XJ language features Demonstrates the key optimizations

IBM Research © 2005 IBM Corporation 14 Performance  Using the DOM API to evaluate XPath expressions at runtime is inefficient  Solution: Compile expressions directly to accesses on DOM tree

IBM Research © 2005 IBM Corporation 15 Advantages of XJ  W3C standards compliance  Ease of programming Seamless integration with Java Robustness: more errors discovered statically Eclipse plug-in coming soon…  Easier maintenance Adapt to changes in XML Schemas Independent of the runtime data representation  Optimizations Compiler rewritings

IBM Research © 2005 IBM Corporation 16 Links  Web site:  Available for free download on alphaWorks 