Handling XML data with Java

Size: px
Start display at page:

Download "Handling XML data with Java"

Transcription

1

2 Handling XML data with Java by Azza NAFTI The success of a project depends on several factors primarily, on the technical choices and the development language. Fortunately, Java software is highly portable across multiple operating systems hence, a solution for free, scalable open-source is achievable. We begin by presenting the article s description and learning goals (XML, Java EE platform). Consequently, we move to the manipulation of XML data with Java. What the article says How to handle XML data, either by creating an XML file, or browse an existing XML file. What you should know This article is intended for a beginner level audience, who already possess a first experience with XML and Java EE platform. We begin with a brief presentation as following: XML stands for extensible Markup Language. It is extensible in a point of not using predefined tags as HTML and allows defining new tags. XML is used to exchange data between disparate applications, because it allows to model and store data in a portable manner. XML and Java have common-based portability through the systems independence and their environment. The Java EE platform is a set of coordinated specifications and practices that enables solutions for developing, deploying, and managing applications. It contains a large number of APIs such as SAX (Simple API for XML) and DOM (Document Object Model). Firstly we will learn how to create an XML file from a Java class. Secondly, we move to step of browsing an XML file and retrieve the desired data from a Java class. All the manipulations will be made using the library JDOM. Definition of JDOM JDOM (abbreviation for Java Document Object Model) is an open source library for handling XML files in Java. It integrates DOM and SAX. Also, it supports XPath and XSLT. And it uses external parsing to build documents. Advantages of JDOM Simplicity The simplicity of JDOM encompasses easy handling and effective XML documents in Java. However, DOM effect was not designed to be implemented in any programming language, and specifically in Java. The main criticism of DOM is that it does not take a full advantage of the Java power. Another criticism is that DOM also must represent HTML (with its imperfections, therefore, not only well-formed XML). The creators of JDOM have started from scratch, designing an API for pure XML and pure Java. The JDOM API is supposed to be more intuitive and less likely to generate programming errors. This ease of use JDOM makes API more widespread. Disadvantages Has less features In the role of three form manipulation, JDOM has fewer features than DOM, on the contrary, it offers greater ease to meet more traditional use cases. 69

3 Features JDOM provides several features: Creating XML documents Encapsulation of an XML document in the form of Java API objects Exporting a document to the file, a SAX stream or a DOM tree Support for XSLT Support for Xpath Characteristics Characteristic points of the JDOM API: It is developed specifically for Java and using the features of Java on syntactic or semantic level (using Java 2 collections, the new operator is able to instantiate elements redefinition of equals(), hashcode(), tostring(), implementing Cloneable and Serializable interfaces,... ) It is intuitive and productive through the classes dedicated to each element, which is instantiated within their constructor and use getter / setter. For example, take a look at the text of an element: DOM: String content = element.getfirstchild().getvalue(); JDOM: String text = element.gettext(); It operates fast and light It intends to hide the complexity of some XML aspects while respecting specifications It must allow interaction between SAX and DOM; JDOM can encapsulate an XML document into a hierarchy of objects from a stream, a DOM tree or SAX events. It is also able to export a document in these formats. Create an XML file You must initially download the latest version of JDOM available at: Then access the file /build/jdom.jar, placing it in your classpath. We will create an XML file containing the coordinates of the employees in a company. We will create the XML root is Company in this case, the Company contains a list of employees Employee, which adequately contains the FirstName and LastName, Age,Occupation/Job/Position, Address and PhoneNumber for each employee in the class JDOM1 present in Listing 1. 70

4 Listing 1. The JDOM1 Class package XMLPackage; import java.io.*; import org.jdom2.*; import org.jdom2.output.*; class JDOM1 static Element root = new Element («Company»); static Document document = new Document(root); public static void main(string[] args) //////////////////////////// Employee1 ///////////////////////////// Element Employee = new Element(«Employee»); root.addcontent(employee); Attribute classe = new Attribute(«degree»,»E1»); Employee.setAttribute(classe); Element FirstName = new Element(«FirstName»); FirstName.setText(«John»); Employee.addContent(FirstName); Element LastName = new Element(«LastName»); LastName.setText(«Blue»); Employee.addContent(LastName); Element Age = new Element(«Age»); Age.setText(«40»); Employee.addContent(Age); Element Job = new Element(«Job»); Job.setText(«Technical Director»); Employee.addContent(Job); Element Address = new Element(«Address»); Address.setText(«London Road No5600,N60»); Employee.addContent(Address); Element PhoneNumber = new Element(«PhoneNumber»); PhoneNumber.setText(« »); Employee.addContent(PhoneNumber); //////////////////////////// Employee2 ///////////////////////////// Element Employee2 = new Element(«Employee»); root.addcontent(employee2); Attribute classe2 = new Attribute(«degree»,»E2»); Employee2.setAttribute(classe2); Element FirstName2 = new Element(«FirstName»); FirstName2.setText(«Davy»); Employee2.addContent(FirstName2); Element LastName2 = new Element(«LastName»); 71

5 LastName2.setText(«Red»); Employee2.addContent(LastName2); Element Age2 = new Element(«Age»); Age2.setText(«30»); Employee2.addContent(Age2); Element Job2 = new Element(«Job»); Job2.setText(«Analyst»); Employee2.addContent(Job2); Element Address2 = new Element(«Address»); Address2.setText(«London Road No8900,N78»); Employee2.addContent(Address2); Element PhoneNumber2 = new Element(«PhoneNumber»); PhoneNumber2.setText(« »); Employee2.addContent(PhoneNumber2); ////////////////////////////// Employee3 /////////////////////////////// Element Employee3 = new Element(«Employee»); root.addcontent(employee3); Attribute classe3 = new Attribute(«degree»,»E3»); Employee3.setAttribute(classe3); Element FirstName3 = new Element(«FirstName»); FirstName3.setText(«Eve»); Employee3.addContent(FirstName3); Element LastName3 = new Element(«LastName»); LastName3.setText(«Green»); Employee3.addContent(LastName3); Element Age3 = new Element(«Age»); Age3.setText(«29»); Employee3.addContent(Age3); Element Job3 = new Element(«Job»); Job3.setText(«Developer»); Employee3.addContent(Job3); Element Address3 = new Element(«Address»); Address3.setText(«London Road No6200,N19»); Employee3.addContent(Address3); Element PhoneNumber3 = new Element(«PhoneNumber»); PhoneNumber3.setText(« »); Employee3.addContent(PhoneNumber3); display(); record(«task1.xml»); static void display() try XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); out.output(document, System.out); 72

6 catch (java.io.ioexception e) static void record(string file) try XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); out.output(document, new FileOutputStream(file)); catch (java.io.ioexception e) Listing 2 shows the generated XML file Task1. Listing 2. The XML file Task1 <?xml version=»1.0» encoding=»utf-8»?> <Company> <Employee degree=»e1»> <FirstName>John</FirstName> <LastName>Blue</LastName> <Age>40</Age> <Job>Technical Director</Job> <Address>London Road No5600,N60</Address> <PhoneNumber> </PhoneNumber> </Employee> <Employee degree=»e2»> <FirstName>Davy</FirstName> <LastName>Red</LastName> <Age>30</Age> <Job>Analyst</Job> <Address>London Road No8900,N78</Address> <PhoneNumber> </PhoneNumber> </Employee> <Employee degree=»e3»> <FirstName>Eve</FirstName> <LastName>Green</LastName> <Age>29</Age> <Job>Developer</Job> <Address>London Road No6200,N19</Address> <PhoneNumber> </PhoneNumber> </Employee> </Company> Parsing an XML file Now we will go through the created XML file in the directory containing our future class JDOM2 shown below in Listing 3. Parse an XML file back to transform an XML file into a JDOM tree. We will use this builder SAXBuilder, based, as the name says on the SAX API. We will use the same XML file (Task1.xml) that we have already created. We ll go and retrieve the FirstName, LastName and Job of each employee. 73

7 Listing 3. The JDOM2 Class package XMLPackage; import java.io.*; import org.jdom2.*; import org.jdom2.input.*; import java.util.list; import java.util.iterator; class JDOM2 static Document document; static Element root; public static void main(string[] args) SAXBuilder sxb = new SAXBuilder(); try document = sxb.build(new File(«Task1.xml»)); catch(exception e) root = document.getrootelement(); displayall(); static void displayall() List listemployees = root.getchildren(«employee»); Iterator i = listemployees.iterator(); while(i.hasnext()) Element current = (Element)i.next(); System.out.print(current.getChild(«FirstName»).getText()); System.out.print( ); System.out.print(current.getChild(«LastName»).getText()); System.out.print( ); System.out.println(current.getChild(«Job»).getText()); The following result will be displayed as shown: John Blue Technical Director Davy Red Analyst Eve Green Developer 74

8 Modify an XML file We will modify the content of our Task1.xml file by removing all Element Address of our tree, creating our class JDOM3 present in Listing 4. Listing 4. The JDOM3 Class package XMLPackage; import java.io.*; import org.jdom2.*; import org.jdom2.input.*; import java.util.list; import java.util.iterator; import org.jdom2.output.*; public class JDOM3 static Document document; static Element root; public static void main(string[] args) try readfile(«task1.xml»); deleteelement(«address»); registerfile(«task2.xml»); catch(exception e) static void readfile(string fichier) throws Exception SAXBuilder sxb = new SAXBuilder(); document = sxb.build(new File(fichier)); root = document.getrootelement(); static void deleteelement(string element) List listemployees = root.getchildren(«employee»); Iterator i = listemployees.iterator(); while(i.hasnext()) Element current = (Element)i.next(); if(current.getchild(element)!=null) current.removechild(element); current.setname(«employee_modify»); static void registerfile(string file) throws Exception XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); 75

9 out.output(document, new FileOutputStream(file)); File Task2.xml will be created. Listing 5 shows the generated XML file Task2. Listing 5. The XML file Task2 <?xml version=»1.0» encoding=»utf-8»?> <Company> <employee_modify degree=»e1»> <FirstName>John</FirstName> <LastName>Blue</LastName> <Age>40</Age> <Job>Technical Director</Job> <PhoneNumber> </PhoneNumber> </employee_modify> <employee_modify degree=»e2»> <FirstName>Davy</FirstName> <LastName>Red</LastName> <Age>30</Age> <Job>Analyst</Job> <PhoneNumber> </PhoneNumber> </employee_modify> <employee_modify degree=»e3»> <FirstName>Eve</FirstName> <LastName>Green</LastName> <Age>29</Age> <Job>Developer</Job> <PhoneNumber> </PhoneNumber> </employee_modify> </Company> Conclusion You ve simply learned how to create an XML file and browse through Java classes. I gladly wish you a good luck in the use of presented tips I strongly recommend to try out as it will certainly fasten your work. About the Author Azza NAFTI: Graduated in Computer Science and Quality. She works at Cassiopae MEA as Technical Consultant since Contact: n_azza@hotmail.fr. 76

Parsing XML documents. DOM, SAX, StAX

Parsing XML documents. DOM, SAX, StAX Parsing XML documents DOM, SAX, StAX XML-parsers XML-parsers are such programs, that are able to read XML documents, and provide access to the contents and structure of the document XML-parsers are controlled

More information

I/O and Parsing Tutorial

I/O and Parsing Tutorial I/O and Parsing Tutorial 22-02-13 Structure of tutorial 1.Example program to access and write to an XML file 2.Example usage of JFlex Tasks program Program to help people plan and manage their work on

More information

Chapter 13 XML: Extensible Markup Language

Chapter 13 XML: Extensible Markup Language Chapter 13 XML: Extensible Markup Language - Internet applications provide Web interfaces to databases (data sources) - Three-tier architecture Client V Application Programs Webserver V Database Server

More information

Hints for Assignment I

Hints for Assignment I Hints for Assignment I Department of Information Technology Uppsala University JDOM JDOM JDOM is an open source library for Javaoptimized XML data manipulations JDOM was created to... Be straightforward

More information

JSON as an XML Alternative. JSON is a light-weight alternative to XML for datainterchange

JSON as an XML Alternative. JSON is a light-weight alternative to XML for datainterchange JSON The Fat-Free Alternative to XML { Lecture : 27, Course : CSC375, Days : TTh", Instructor : Haidar Harmanani } JSON as an XML Alternative JSON is a light-weight alternative to XML for datainterchange

More information

XML. Jonathan Geisler. April 18, 2008

XML. Jonathan Geisler. April 18, 2008 April 18, 2008 What is? IS... What is? IS... Text (portable) What is? IS... Text (portable) Markup (human readable) What is? IS... Text (portable) Markup (human readable) Extensible (valuable for future)

More information

JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript Object Notation

JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript Object Notation JSON The Fat-Free Alternative to XML { Lecture : 27, Course : CSC375, Days : TTh", Instructor : Haidar Harmanani } Why JSON? JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript

More information

XML Extensible Markup Language

XML Extensible Markup Language XML Extensible Markup Language Generic format for structured representation of data. DD1335 (Lecture 9) Basic Internet Programming Spring 2010 1 / 34 XML Extensible Markup Language Generic format for structured

More information

.. Cal Poly CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar..

.. Cal Poly CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar.. .. Cal Poly CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar.. XML in a Nutshell XML, extended Markup Language is a collection of rules for universal markup of data. Brief History

More information

Persistent Data. Eric McCreath

Persistent Data. Eric McCreath Persistent Data Eric McCreath 2 Overview In this lecture we will: Consider different approaches for storing a programs information. using Serializable, Bespoke text formats, XML, JSON, and consider the

More information

BEAWebLogic Server. Monitoring and Managing with the Java EE Management APIs

BEAWebLogic Server. Monitoring and Managing with the Java EE Management APIs BEAWebLogic Server Monitoring and Managing with the Java EE Management APIs Version 10.0 Revised: March 30, 2007 Contents 1. Introduction and Roadmap Document Scope and Audience.............................................

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Advanced Java Exercises

Advanced Java Exercises Advanced Java Exercises Generics Exercise 1: Write a generic method to exchange the positions of two different elements in an array. Exercise 2: Consider the following classes: public class AnimalHouse

More information

Advanced Java Programming

Advanced Java Programming Advanced Java Programming Length: 4 days Description: This course presents several advanced topics of the Java programming language, including Servlets, Object Serialization and Enterprise JavaBeans. In

More information

Input & Output in Java. Standard I/O Exception Handling

Input & Output in Java. Standard I/O Exception Handling Input & Output in Java Standard I/O Exception Handling Java I/O: Generic & Complex Java runs on a huge variety of plaforms to accomplish this, a Java Virtual Machine (JVM) is written for every type of

More information

Self-test Java Programming

Self-test Java Programming Self-test Java Programming Document: e0883test.fm 16 January 2018 ABIS Training & Consulting Diestsevest 32 / 4b B-3000 Leuven Belgium TRAINING & CONSULTING INTRODUCTION TO THE SELF-TEST JAVA PROGRAMMING

More information

Web architectures Laurea Specialistica in Informatica Università di Trento. DOM architecture

Web architectures Laurea Specialistica in Informatica Università di Trento. DOM architecture DOM architecture DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setvalidating(true); // optional default is non-validating DocumentBuilder db = dbf.newdocumentbuilder(); Document

More information

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable?

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable? Peer Instruction 8 Classes and Objects How can multiple methods within a Java class read and write the same variable? A. Allow one method to reference a local variable of the other B. Declare a variable

More information

OO and Ahh! An Introduction to Object Oriented Programming With PHP. Division 1 Systems. John Valance. Copyright John Valance Division 1 Systems

OO and Ahh! An Introduction to Object Oriented Programming With PHP. Division 1 Systems. John Valance. Copyright John Valance Division 1 Systems OO and Ahh! An Introduction to Object Oriented Programming With PHP John Valance Division 1 Systems johnv@div1sys.com Copyright John Valance Division 1 Systems About John Valance 30+ years IBM midrange

More information

Previous to Chapter 7 Files

Previous to Chapter 7 Files Previous to Chapter 7 Files Recall Scanner from Part I notes. A scanner object can reference a text file Scanner f = new Scanner(new File("file name goes here")); Scanner methods can be applied to reading

More information

CMPSCI 187: Programming With Data Structures. Lecture #24: Files and a Case Study David Mix Barrington 2 November 2012

CMPSCI 187: Programming With Data Structures. Lecture #24: Files and a Case Study David Mix Barrington 2 November 2012 CMPSCI 187: Programming With Data Structures Lecture #24: Files and a Case Study David Mix Barrington 2 November 2012 Files and a Case Study Volatile and Non-Volatile Storage Storing and Retrieving Objects

More information

Classes. Classes as Code Libraries. Classes as Data Structures. Classes/Objects/Interfaces (Savitch, Various Chapters)

Classes. Classes as Code Libraries. Classes as Data Structures. Classes/Objects/Interfaces (Savitch, Various Chapters) Classes Classes/Objects/Interfaces (Savitch, Various Chapters) TOPICS Classes Public versus Private Static Data Static Methods Interfaces Classes are the basis of object-oriented (OO) programming. They

More information

COURSE SYLLABUS. Complete JAVA. Industrial Training (3 MONTHS) PH : , Vazhoor Road Changanacherry-01.

COURSE SYLLABUS. Complete JAVA. Industrial Training (3 MONTHS) PH : , Vazhoor Road Changanacherry-01. COURSE SYLLABUS Complete JAVA Industrial Training (3 MONTHS) PH : 0481 2411122, 09495112288 E-Mail : info@faithinfosys.com www.faithinfosys.com Marette Tower Near No. 1 Pvt. Bus Stand Vazhoor Road Changanacherry-01

More information

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University Introduction to XML Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University http://gear.kku.ac.th/~krunapon/xmlws 1 Topics p What is XML? p Why XML? p Where does XML

More information

(a) Write the signature (visibility, name, parameters, types) of the method(s) required

(a) Write the signature (visibility, name, parameters, types) of the method(s) required 1. (6 pts) Is the final comprehensive? 1 2. (6 pts) Java has interfaces Comparable and Comparator. As discussed in class, what is the main advantage of Comparator? 3. (6 pts) We can use a comparator in

More information

HIBERNATE - INTERCEPTORS

HIBERNATE - INTERCEPTORS HIBERNATE - INTERCEPTORS http://www.tutorialspoint.com/hibernate/hibernate_interceptors.htm Copyright tutorialspoint.com As you have learnt that in Hibernate, an object will be created and persisted. Once

More information

IST311 Chapter 8: C# Collections - Index-Sequential Search List & Dictionary PROGRAM

IST311 Chapter 8: C# Collections - Index-Sequential Search List & Dictionary PROGRAM IST311 Chapter 8: C# Collections - Index-Sequential Search List & Dictionary PROGRAM class Program static void Main(string[] args) //create a few employees Employee e1 = new Employee(1111111, "Tiryon",

More information

Supports 1-1, 1-many, and many to many relationships between objects

Supports 1-1, 1-many, and many to many relationships between objects Author: Bill Ennis TOPLink provides container-managed persistence for BEA Weblogic. It has been available for Weblogic's application server since Weblogic version 4.5.1 released in December, 1999. TOPLink

More information

Introduction to XML 3/14/12. Introduction to XML

Introduction to XML 3/14/12. Introduction to XML Introduction to XML Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University http://gear.kku.ac.th/~krunapon/xmlws 1 Topics p What is XML? p Why XML? p Where does XML

More information

1 Introduction and Roadmap

1 Introduction and Roadmap Oracle Fusion Middleware Monitoring and Managing With the Java EE Management APIs for Oracle WebLogic Server 11g Release 1 (10.3.1) E13736-01 May 2009 This document describes the Java EE Management APIs

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

Classes. Classes as Code Libraries. Classes as Data Structures

Classes. Classes as Code Libraries. Classes as Data Structures Classes Classes/Objects/Interfaces (Savitch, Various Chapters) TOPICS Classes Public versus Private Static Data Static Methods Interfaces Classes are the basis of object-oriented (OO) programming. They

More information

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar Java Classes Introduction to the Java Programming Language Produced by Eamonn de Leastar edeleastar@wit.ie Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Oral Question Bank for CL-3 Assignment

Oral Question Bank for CL-3 Assignment Oral Question Bank for CL-3 Assignment What is difference between JDK,JRE and JVM? What do you mean by platform independence? What is class loader and byte code? What is class, Object? what is mean by

More information

XML. Technical Talk. by Svetlana Slavova. CMPT 842, Feb

XML. Technical Talk. by Svetlana Slavova. CMPT 842, Feb XML Technical Talk by Svetlana Slavova 1 Outline Introduction to XML XML vs. Serialization Curious facts, advantages & weaknesses XML syntax Parsing XML Example References 2 Introduction to XML (I) XML

More information

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010 Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010 NAME (Printed) NAME (Signed) E-mail Exam Rules Show all your work. Your grade will

More information

CHAPTER 1 USING JAXP FOR XML TRANSFORMATIONS

CHAPTER 1 USING JAXP FOR XML TRANSFORMATIONS CHAPTER 1 USING JAXP FOR XML TRANSFORMATIONS OBJECTIVES After completing Using JAXP for XML Transformations, you will be able to: Describe the role of JAXP in XML transformations. Instantiate a Transformer

More information

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

Delivery Options: Attend face-to-face in the classroom or remote-live attendance. XML Programming Duration: 5 Days Price: $2795 *California residents and government employees call for pricing. Discounts: We offer multiple discount options. Click here for more info. Delivery Options:

More information

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction OGIES 6/7 A- Core Java The Core Java segment deals with the basics of Java. It is designed keeping in mind the basics of Java Programming Language that will help new students to understand the Java language,

More information

Chapter 3. Architecture and Design

Chapter 3. Architecture and Design Chapter 3. Architecture and Design Design decisions and functional architecture of the Semi automatic generation of warehouse schema has been explained in this section. 3.1. Technical Architecture System

More information

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple magazine data system. Milestones:

More information

Java Primer. CITS2200 Data Structures and Algorithms. Topic 2

Java Primer. CITS2200 Data Structures and Algorithms. Topic 2 CITS2200 Data Structures and Algorithms Topic 2 Java Primer Review of Java basics Primitive vs Reference Types Classes and Objects Class Hierarchies Interfaces Exceptions Reading: Lambert and Osborne,

More information

11. EXTENSIBLE MARKUP LANGUAGE (XML)

11. EXTENSIBLE MARKUP LANGUAGE (XML) 11. EXTENSIBLE MARKUP LANGUAGE (XML) Introduction Extensible Markup Language is a Meta language that describes the contents of the document. So these tags can be called as self-describing data tags. XML

More information

Developing Java EE Management Applications for Oracle WebLogic Server c (12.1.3)

Developing Java EE Management Applications for Oracle WebLogic Server c (12.1.3) [1]Oracle Fusion Middleware Developing Java EE Management Applications for Oracle WebLogic Server 12.1.3 12c (12.1.3) E41880-04 August 2015 This document describes the Java EE Management APIs for WebLogic

More information

1 Introduction and Roadmap

1 Introduction and Roadmap Oracle Fusion Middleware Monitoring and Managing With the Java EE Management APIs for Oracle WebLogic Server 11g Release 1 (10.3.6) E13736-06 November 2011 This document describes the Java EE Management

More information

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY A PATH FOR HORIZING YOUR INNOVATIVE WORK CONVERTING XML DOCUMENT TO SQL QUERY MISS. ANUPAMA V. ZAKARDE 1, DR. H. R. DESHMUKH

More information

Document Parser Interfaces. Tasks of a Parser. 3. XML Processor APIs. Document Parser Interfaces. ESIS Example: Input document

Document Parser Interfaces. Tasks of a Parser. 3. XML Processor APIs. Document Parser Interfaces. ESIS Example: Input document 3. XML Processor APIs How applications can manipulate structured documents? An overview of document parser interfaces 3.1 SAX: an event-based interface 3.2 DOM: an object-based interface Document Parser

More information

D WSMO Data Grounding Component

D WSMO Data Grounding Component Project Number: 215219 Project Acronym: SOA4All Project Title: Instrument: Thematic Priority: Service Oriented Architectures for All Integrated Project Information and Communication Technologies Activity

More information

CO Java SE 8: Fundamentals

CO Java SE 8: Fundamentals CO-83527 Java SE 8: Fundamentals Summary Duration 5 Days Audience Application Developer, Developer, Project Manager, Systems Administrator, Technical Administrator, Technical Consultant and Web Administrator

More information

Lab 5: Java IO 12:00 PM, Feb 21, 2018

Lab 5: Java IO 12:00 PM, Feb 21, 2018 CS18 Integrated Introduction to Computer Science Fisler, Nelson Contents Lab 5: Java IO 12:00 PM, Feb 21, 2018 1 The Java IO Library 1 2 Program Arguments 2 3 Readers, Writers, and Buffers 2 3.1 Buffering

More information

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards Representing Web Data: XML XML Example XML document: An XML document is one that follows certain syntax rules (most of which we followed for XHTML) Guy-Vincent

More information

Java Input/Output. 11 April 2013 OSU CSE 1

Java Input/Output. 11 April 2013 OSU CSE 1 Java Input/Output 11 April 2013 OSU CSE 1 Overview The Java I/O (Input/Output) package java.io contains a group of interfaces and classes similar to the OSU CSE components SimpleReader and SimpleWriter

More information

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently. Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple movie data system. Milestones: 1. Use

More information

Distributed Systems Recitation 1. Tamim Jabban

Distributed Systems Recitation 1. Tamim Jabban 15-440 Distributed Systems Recitation 1 Tamim Jabban Office Hours Office 1004 Tuesday: 9:30-11:59 AM Thursday: 10:30-11:59 AM Appointment: send an e-mail Open door policy Java: Object Oriented Programming

More information

Lesson 10B Class Design. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10B Class Design. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10B Class Design By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Encapsulation Inheritance and Composition is a vs has a Polymorphism Information Hiding Public

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Servlet for Json or CSV (or XML) A servlet serving either Json or CSV (or XML) based on GET parameter - This version uses org.json

Servlet for Json or CSV (or XML) A servlet serving either Json or CSV (or XML) based on GET parameter - This version uses org.json Servlet for Json or CSV (or XML) A servlet serving either Json or CSV (or XML) based on GET parameter - This version uses org.json A Servlet used as an API for data Let s say we want to write a Servlet

More information

Data Presentation and Markup Languages

Data Presentation and Markup Languages Data Presentation and Markup Languages MIE456 Tutorial Acknowledgements Some contents of this presentation are borrowed from a tutorial given at VLDB 2000, Cairo, Agypte (www.vldb.org) by D. Florescu &.

More information

developer.* The Independent Magazine for Software Professionals Factory Chain: A Design Pattern for Factories with Generics by Hugo Troche

developer.* The Independent Magazine for Software Professionals Factory Chain: A Design Pattern for Factories with Generics by Hugo Troche developer.* The Independent Magazine for Software Professionals Factory Chain: A Design Pattern for Factories with Generics by Hugo Troche Introduction The recent Java 5 (a.k.a. Java 1.5) generics implementation

More information

CS1083 Week 2: Arrays, ArrayList

CS1083 Week 2: Arrays, ArrayList CS1083 Week 2: Arrays, ArrayList mostly review David Bremner 2018-01-08 Arrays (1D) Declaring and using 2D Arrays 2D Array Example ArrayList and Generics Multiple references to an array d o u b l e prices

More information

SeU Certified Selenium Engineer (CSE) Syllabus

SeU Certified Selenium Engineer (CSE) Syllabus SeU Certified Selenium Engineer (CSE) Syllabus Released Version 2018 Selenium United Version 2018, released 23.08.2018 Page 1 of 16 Copyright Notice This document may be copied in its entirety, or extracts

More information

Java Import Xsd Schema Validate Xml Against Multiple

Java Import Xsd Schema Validate Xml Against Multiple Java Import Xsd Schema Validate Xml Against Multiple Ensuring the XML can be validated against an XSD, regardless of directory structure, requires a catalog resolver. Once the package src, import java.io.

More information

Oracle Fusion Middleware Developing Java EE Management Applications for Oracle WebLogic Server. 12c ( )

Oracle Fusion Middleware Developing Java EE Management Applications for Oracle WebLogic Server. 12c ( ) Oracle Fusion Middleware Developing Java EE Management Applications for Oracle WebLogic Server 12c (12.2.1.3.0) E80441-01 August 2017 Oracle Fusion Middleware Developing Java EE Management Applications

More information

Appendices Attached (2 pages) Two Hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE QUESTION PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM

Appendices Attached (2 pages) Two Hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE QUESTION PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM Appendices Attached (2 pages) COMP27010 Two Hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE QUESTION PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM Object Oriented Programming 2 Date: Monday 19

More information

Database Application Architectures

Database Application Architectures Chapter 15 Database Application Architectures Database Systems(Part 2) p. 221/287 Database Applications Most users do not interact directly with a database system The DBMS is hidden behind application

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1 Slide 27-1 Chapter 27 XML: Extensible Markup Language Chapter Outline Introduction Structured, Semi structured, and Unstructured Data. XML Hierarchical (Tree) Data Model. XML Documents, DTD, and XML Schema.

More information

The Xlint Project * 1 Motivation. 2 XML Parsing Techniques

The Xlint Project * 1 Motivation. 2 XML Parsing Techniques The Xlint Project * Juan Fernando Arguello, Yuhui Jin {jarguell, yhjin}@db.stanford.edu Stanford University December 24, 2003 1 Motivation Extensible Markup Language (XML) [1] is a simple, very flexible

More information

Distributed Systems Recitation 1. Tamim Jabban

Distributed Systems Recitation 1. Tamim Jabban 15-440 Distributed Systems Recitation 1 Tamim Jabban Office Hours Office 1004 Sunday, Tuesday: 9:30-11:59 AM Appointment: send an e-mail Open door policy Java: Object Oriented Programming A programming

More information

XML: Extensible Markup Language

XML: Extensible Markup Language XML: Extensible Markup Language CSC 375, Fall 2015 XML is a classic political compromise: it balances the needs of man and machine by being equally unreadable to both. Matthew Might Slides slightly modified

More information

Agenda. Summary of Previous Session. XML for Java Developers G Session 6 - Main Theme XML Information Processing (Part II)

Agenda. Summary of Previous Session. XML for Java Developers G Session 6 - Main Theme XML Information Processing (Part II) XML for Java Developers G22.3033-002 Session 6 - Main Theme XML Information Processing (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

CMPSCI 187: Programming With Data Structures. Lecture 6: The StringLog ADT David Mix Barrington 17 September 2012

CMPSCI 187: Programming With Data Structures. Lecture 6: The StringLog ADT David Mix Barrington 17 September 2012 CMPSCI 187: Programming With Data Structures Lecture 6: The StringLog ADT David Mix Barrington 17 September 2012 The StringLog ADT Data Abstraction Three Views of Data Java Interfaces Defining the StringLog

More information

Project 1: Remote Method Invocation CSE 291 Spring 2016

Project 1: Remote Method Invocation CSE 291 Spring 2016 Project 1: Remote Method Invocation CSE 291 Spring 2016 Assigned: Tuesday, 5 April Due: Thursday, 28 April Overview In this project, you will implement a remote method invocation (RMI) library. RMI forwards

More information

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p.

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p. Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p. 16 Attributes p. 17 Comments p. 18 Document Type Definition

More information

Serialization. Lab 1 JSON

Serialization. Lab 1 JSON Lab 1 Serialization Lab Objective: Learn about JSON and XML. In order for computers to communicate one with another, they need standardized ways of storing structured data. For example, suppose you have

More information

Data Exchange. Hyper-Text Markup Language. Contents: HTML Sample. HTML Motivation. Cascading Style Sheets (CSS) Problems w/html

Data Exchange. Hyper-Text Markup Language. Contents: HTML Sample. HTML Motivation. Cascading Style Sheets (CSS) Problems w/html Data Exchange Contents: Mariano Cilia / cilia@informatik.tu-darmstadt.de Origins (HTML) Schema DOM, SAX Semantic Data Exchange Integration Problems MIX Model 1 Hyper-Text Markup Language HTML Hypertext:

More information

Project #1 Computer Science 2334 Fall 2008

Project #1 Computer Science 2334 Fall 2008 Project #1 Computer Science 2334 Fall 2008 User Request: Create a Word Verification System. Milestones: 1. Use program arguments to specify a file name. 10 points 2. Use simple File I/O to read a file.

More information

Make sure you have the latest Hive trunk by running svn up in your Hive directory. More detailed instructions on downloading and setting up

Make sure you have the latest Hive trunk by running svn up in your Hive directory. More detailed instructions on downloading and setting up GenericUDAFCaseStudy Writing GenericUDAFs: A Tutorial User-Defined Aggregation Functions (UDAFs) are an excellent way to integrate advanced data-processing into Hive. Hive allows two varieties of UDAFs:

More information

CS 201, Fall 2016 Sep 28th Exam 1

CS 201, Fall 2016 Sep 28th Exam 1 CS 201, Fall 2016 Sep 28th Exam 1 Name: Question 1. [5 points] Write code to prompt the user to enter her age, and then based on the age entered, print one of the following messages. If the age is greater

More information

CST141 Thinking in Objects Page 1

CST141 Thinking in Objects Page 1 CST141 Thinking in Objects Page 1 1 2 3 4 5 6 7 8 Object-Oriented Thinking CST141 Class Abstraction and Encapsulation Class abstraction is the separation of class implementation from class use It is not

More information

A final method is a method which cannot be overridden by subclasses. A class that is declared final cannot be inherited.

A final method is a method which cannot be overridden by subclasses. A class that is declared final cannot be inherited. final A final variable is a variable which can be initialized once and cannot be changed later. The compiler makes sure that you can do it only once. A final variable is often declared with static keyword

More information

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML Chapter 7 XML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML

More information

SYLLABUS JAVA COURSE DETAILS. DURATION: 60 Hours. With Live Hands-on Sessions J P I N F O T E C H

SYLLABUS JAVA COURSE DETAILS. DURATION: 60 Hours. With Live Hands-on Sessions J P I N F O T E C H JAVA COURSE DETAILS DURATION: 60 Hours With Live Hands-on Sessions J P I N F O T E C H P U D U C H E R R Y O F F I C E : # 4 5, K a m a r a j S a l a i, T h a t t a n c h a v a d y, P u d u c h e r r y

More information

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE PART 1 Eclipse IDE Tutorial Eclipse Java IDE This tutorial describes the usage of Eclipse as a Java IDE. It describes the installation of Eclipse, the creation of Java programs and tips for using Eclipse.

More information

Exception Handling in Java. An Exception is a compile time / runtime error that breaks off the

Exception Handling in Java. An Exception is a compile time / runtime error that breaks off the Description Exception Handling in Java An Exception is a compile time / runtime error that breaks off the program s execution flow. These exceptions are accompanied with a system generated error message.

More information

Intro to XML. Borrowed, with author s permission, from:

Intro to XML. Borrowed, with author s permission, from: Intro to XML Borrowed, with author s permission, from: http://business.unr.edu/faculty/ekedahl/is389/topic3a ndroidintroduction/is389androidbasics.aspx Part 1: XML Basics Why XML Here? You need to understand

More information

Another IS-A Relationship

Another IS-A Relationship Another IS-A Relationship Not all classes share a vertical relationship. Instead, some are supposed to perform the specific methods without a vertical relationship. Consider the class Bird inherited from

More information

Training topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives

Training topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives Training topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives 1 Table of content TABLE OF CONTENT... 2 1. ABOUT OCPJP SCJP... 4 2.

More information

SeU Certified Selenium Engineer (CSE) Syllabus

SeU Certified Selenium Engineer (CSE) Syllabus SeU Certified Selenium Engineer (CSE) Syllabus Released Version 2018 Selenium United Version 2018, released 23.08.2018 Page 1 of 16 Copyright Notice This document may be copied in its entirety, or extracts

More information

Exploring the Java API, Packages & Collections

Exploring the Java API, Packages & Collections 6.092 - Introduction to Software Engineering in Java Lecture 7: Exploring the Java API, Packages & Collections Tuesday, January 29 IAP 2008 Cite as: Evan Jones, Olivier Koch, and Usman Akeju, course materials

More information

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML INTRODUCTION 2 THE XML LANGUAGE XML: Extensible Markup Language Standard for the presentation and transmission of information.

More information

WHAT IS EJB. Security. life cycle management.

WHAT IS EJB. Security. life cycle management. EJB WHAT IS EJB EJB is an acronym for enterprise java bean. It is a specification provided by Sun Microsystems to develop secured, robust and scalable distributed applications. To run EJB application,

More information

XML APIs. Web Data Management and Distribution. Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart

XML APIs. Web Data Management and Distribution. Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart XML APIs Web Data Management and Distribution Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart http://gemo.futurs.inria.fr/wdmd January 25, 2009 Gemo, Lamsade, LIG, Telecom (WDMD)

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #13: Java OO cont d. Janak J Parekh janak@cs.columbia.edu Administrivia Homework due next week Problem #2 revisited Constructors, revisited Remember: a

More information

PL/I for OpenVMS and Tru64

PL/I for OpenVMS and Tru64 PL/I for OpenVMS and Tru64 WSIT and J2VMS: A Comparative Analysis Tim E. Sneddon WSIT and J2VMS: A Comparative Analysis...1 Introduction...2 Acknowledgements...2 Structures...2 Constants...5 Routines...6

More information

Java and XML. XML documents consist of Elements. Each element will contains other elements and will have Attributes. For example:

Java and XML. XML documents consist of Elements. Each element will contains other elements and will have Attributes. For example: Java and XML XML Documents An XML document is a way to represent structured information in a neutral format. The purpose of XML documents is to provide a way to represent data in a vendor and software

More information

J2EE Technologies. Industrial Training

J2EE Technologies. Industrial Training COURSE SYLLABUS J2EE Technologies Industrial Training (4 MONTHS) PH : 0481 2411122, 09495112288 Marette Tower E-Mail : info@faithinfosys.com Near No. 1 Pvt. Bus Stand Vazhoor Road Changanacherry-01 www.faithinfosys.com

More information

Module 6: Binary Trees

Module 6: Binary Trees Module : Binary Trees Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 327 E-mail: natarajan.meghanathan@jsums.edu Tree All the data structures we have seen

More information

M359 Block5 - Lecture12 Eng/ Waleed Omar

M359 Block5 - Lecture12 Eng/ Waleed Omar Documents and markup languages The term XML stands for extensible Markup Language. Used to label the different parts of documents. Labeling helps in: Displaying the documents in a formatted way Querying

More information

The XML PDF Access API for Java Technology (XPAAJ)

The XML PDF Access API for Java Technology (XPAAJ) The XML PDF Access API for Java Technology (XPAAJ) Duane Nickull Senior Technology Evangelist Adobe Systems TS-93260 2007 JavaOne SM Conference Session TS-93260 Agenda Using Java technology to manipulate

More information

CS 335 Java Programming Controls. Fall 2007

CS 335 Java Programming Controls. Fall 2007 CS 335 Java Programming Controls Fall 2007 Java Control Structures Selection: If, If/Else, Switch Repetition (looping): While, For, Do/While Assignment: Expressions, increment/decrement Java Reserved Words

More information