raghavachari

Information about raghavachari

Published on December 4, 2007

Author: Mee12

Source: authorstream.com

Content

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: [email protected]

Related presentations


Other presentations created by Mee12

08 Dog and Cat Nutrition
16. 11. 2007
0 views

08 Dog and Cat Nutrition

miguel angel bustamante
01. 10. 2007
0 views

miguel angel bustamante

Athens 2004
02. 10. 2007
0 views

Athens 2004

hauer1
27. 09. 2007
0 views

hauer1

aws
06. 11. 2007
0 views

aws

Chapters 9 10
26. 11. 2007
0 views

Chapters 9 10

ContinuousIntegration final
28. 11. 2007
0 views

ContinuousIntegration final

N A V I G T O R S VBB 2007
30. 11. 2007
0 views

N A V I G T O R S VBB 2007

Fruit Insects
01. 12. 2007
0 views

Fruit Insects

Test Anxiety 1
06. 12. 2007
0 views

Test Anxiety 1

ProvidentialHistory
31. 10. 2007
0 views

ProvidentialHistory

chap08 og
01. 11. 2007
0 views

chap08 og

handout 184637
05. 11. 2007
0 views

handout 184637

2004 harm present
05. 11. 2007
0 views

2004 harm present

E DESC AK PACOM POL CONF ver31
13. 11. 2007
0 views

E DESC AK PACOM POL CONF ver31

bedeutung innovation
15. 11. 2007
0 views

bedeutung innovation

Parity01 grames slides
23. 11. 2007
0 views

Parity01 grames slides

GA Conf07Lomas
13. 12. 2007
0 views

GA Conf07Lomas

CooperativeLearning
17. 12. 2007
0 views

CooperativeLearning

Friendship 1
23. 12. 2007
0 views

Friendship 1

plant lifecycles
28. 12. 2007
0 views

plant lifecycles

Millay
28. 12. 2007
0 views

Millay

alterman pki 05 13 01
01. 01. 2008
0 views

alterman pki 05 13 01

RMA 2005
02. 01. 2008
0 views

RMA 2005

OH
04. 01. 2008
0 views

OH

pp Bioeconomy Polansky Dec2007
04. 01. 2008
0 views

pp Bioeconomy Polansky Dec2007

nazca lines
07. 01. 2008
0 views

nazca lines

4330IBS
30. 10. 2007
0 views

4330IBS

Wk4 Mon
04. 01. 2008
0 views

Wk4 Mon

lh1
21. 11. 2007
0 views

lh1

econ and mgnt of privatization
20. 11. 2007
0 views

econ and mgnt of privatization

jre imps2005
06. 11. 2007
0 views

jre imps2005

EE541 451 class29
28. 11. 2007
0 views

EE541 451 class29

Aquatic Equipment
08. 11. 2007
0 views

Aquatic Equipment

WomensEmploymentJan2 001
24. 02. 2008
0 views

WomensEmploymentJan2 001

1025 QM05 Nardi
29. 10. 2007
0 views

1025 QM05 Nardi

wendybear
24. 12. 2007
0 views

wendybear

Martinac
14. 03. 2008
0 views

Martinac

DynaMed
25. 10. 2007
0 views

DynaMed

IntStu
27. 03. 2008
0 views

IntStu

Country Risk Sep07
13. 04. 2008
0 views

Country Risk Sep07

Eco 336 Constitutional Limits on
17. 12. 2007
0 views

Eco 336 Constitutional Limits on

2003 lecture crypto1
31. 12. 2007
0 views

2003 lecture crypto1

robo lectures
14. 11. 2007
0 views

robo lectures

Ders1
29. 12. 2007
0 views

Ders1

REDLOBSTER
07. 12. 2007
0 views

REDLOBSTER

WarmUps WHII
25. 12. 2007
0 views

WarmUps WHII

pres riccardo
30. 10. 2007
0 views

pres riccardo

Chapt3overhead
12. 11. 2007
0 views

Chapt3overhead

SHFA280301
28. 11. 2007
0 views

SHFA280301

IfA jan03v1
15. 11. 2007
0 views

IfA jan03v1