advertisement

raghavachari

67 %
33 %
advertisement
Information about raghavachari
Entertainment

Published on December 4, 2007

Author: Mee12

Source: authorstream.com

advertisement

XJ: Robust XML Processing in Java™:  XJ: Robust XML Processing in Java™ Mukund Raghavachari with Rajesh Bordawekar, Michael Burke, and Igor Peshansky XML is Pervasive:  XML is Pervasive Messaging Legacy Databases Web Services Programming is tedious, error-prone, and inefficient DOM :  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(recipe); JAXB:  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 XSLT and XQuery:  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 XJ Design Goals:  XJ Design Goals Make XML a first-class construct in Java Consistency with XML standards (Namespaces, XML Schema, XPath) Minimal changes to Java Efficiency Support both schema and schema-less processing XML processing applications are easier to write, more robust, and efficient XJ Features:  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 Sample XJ Program:  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<Details> bookSeq = pi[| .//Details[ProductName = $title] |]; for (XMLCursor<Details> 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 name='{title}' > <isbn> {book[| /Isbn |] } </isbn> <price> {book[| //Price |] * discountMult} </price> </Book>); return result; }}} Refer to schema declarations Inline XPath XML Construction XPath Navigation:  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<Details> 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. Construction of XML:  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( <Book year="2004"> <title>C# Concisely</title> <author> <first>Judith</first><last>Bishop</last> </author> <author> <first>Nigel</first><last>Horspool</last> </author> <publisher>Addison-Wesley</publisher> <price> {price} </price> </Book>); XMLElement b = new XMLElement( XML Updates:  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”); XJ Compiler and Runtime System:  XJ Compiler and Runtime System xjc XJ Source + XML Schemas Eclipse JDT Java bytecode xj JRE Demo Details:  Demo Details Based on “recipes” example from XML tutorial Convert list of recipes to HTML Originally XSLT (construction, XPath) Consolidate shopping list XPath + updates Performance:  Performance Using the DOM API to evaluate XPath expressions at runtime is inefficient Solution: Compile expressions directly to accesses on DOM tree Advantages of XJ:  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 Links:  Links Web site: http://www.research.ibm.com/xj/ Available for free download on alphaWorks http://www.alphaworks.ibm.com/tech/xj/ E-mail: xj@watson.ibm.com

Add a comment

Related presentations

Related pages

Indiana University Bloomington - Krishnan Raghavachari

Krishnan Raghavachari obtained his B.Sc. Degree in 1973 from Madras University and his M.Sc. Degree from Indian Institute of Technology, Madras in 1975.
Read more

Krishnan Raghavachari – Wikipedia

Krishnan Raghavachari (* 3. April 1953 in Madras, Indien) ist ein indischer Chemiker und Physiker. Raghavachari erhielt 1973 den BSc an der University of ...
Read more

Raghavachari S Nambi - CEO - R S N & Associates | XING

We are a Multi-specialty Management consultancy firm comprising of CAs; MBAs; Bankers; Lawyers and industry specialists focusing on all types of Management ...
Read more

Krishnan Raghavachari - Gaussian

Krishnan Raghavachari. Email: kraghava@indiana.edu ... K. Raghavachari, J. B. Anderson, "Electron correlation effects in molecules," J. Phys. Chem. 100 ...
Read more

Vasudevan Raghavachari - Director - QLogy Management ...

Anmelden und ganzes Profil ansehen Anmelden und Profil ansehen. E-Mail. Telefon. Adresse. Messenger. Fax. Website
Read more

Nalini RAGHAVACHARI | National Institute on Aging

Biography: Nalini Raghavachari joined NIA’s Division of Geriatrics and Clinical Gerontology in 2013 as a program officer and is currently focusing on ...
Read more

Chidanandam - Hyderabad Brothers Live at Chidambaram ...

Chidanandam - Hyderabad Brothers Live at Chidambaram D. Seshachari, D. Raghavachari, Mridangam: Srimushnam V.Raja Rao, Ghatam: T.V.Vasan, Violin: Delhi P ...
Read more

Top 10 Raghavachari profiles | LinkedIn

View the profiles of professionals named Raghavachari on LinkedIn. There are 142 professionals named Raghavachari, who use LinkedIn to exchange information ...
Read more

Uppili Raghavachari - IMDb

Uppili Raghavachari, Producer: The Helpline. Uppili Raghavachari is a producer and director, known for The Helpline (2013), Death Lies on Her (2016) and ...
Read more

Dr. Raghavachari Krishnan, MD - Clanton, AL - General ...

Visit Healthgrades for information on Dr. Raghavachari Krishnan, MD. Find Phone & Address information, medical practice history, affiliated hospitals and more.
Read more