XML Android Club 2015. Agenda XML JSON XML eXtensible Markup Language Used for: data transfer PHP -> Java.

Slides:



Advertisements
Similar presentations
XPathAPI XPathAPI HOME : API : j/apidocs/ Lib.
Advertisements

The Java Platform and XML Portable Code, Portable Data James Duncan Davidson Staff Engineer, Sun Microsystems, Inc.
1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
Schema validation with java xml xsd Agenda Umgebung Programm Output.
Classmates Tags Directory Presented by: Cindy Zhang.
The Semantic Web. The Web Today Designed for Human to read Cannot express meaning Architecture: URL –Decentralized: Link structure Language: html.
XML Parsing Using Java APIs AIP Independence project Fall 2010.
11-Jun-15 More DOM. Manipulating DOM trees DOM, unlike SAX, gives you the ability to create and modify XML trees There are a few roadblocks along the.
14-Jun-15 DOM. SAX and DOM SAX and DOM are standards for XML parsers-- program APIs to read and interpret XML files DOM is a W3C standard SAX is an ad-hoc.
Tomcat Java and XML. Announcements  Final homework assigned Wednesday  Two week deadline  Will cover servlets + JAXP.
Xerces The Apache XML Project Yvonne Yao. Introduction Set of libraries that provides functionalities to parse XML documents Set of libraries that provides.
1 Processing XML with Java Representation and Management of Data on the Internet A comprehensive tutorial about XML processing with JavaXML processing.
1 Processing XML with Java CS , Spring 2008/9.
Fonts and colors Times New Roman “quotes” Trebuchet "quotes" yellow blue pink green violet.
JAX- Java APIs for XML by J. Pearce. Some XML Standards Basic –SAX (sequential access parser) –DOM (random access parser) –XSL (XSLT, XPATH) –DTD Schema.
29-Jun-15 JAXB Java Architecture for XML Binding.
Chapter 24 XML. CHAPTER GOALS Understanding XML elements and attributes Understanding the concept of an XML parser Being able to read and write XML documents.
Xpath Sources:
Effective XML Elliotte Rusty Harold
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools Leonidas Fegaras.
17 Apr 2002 XML Programming: JAXP Andy Clark. Java API for XML Processing Standard Java API for loading, creating, accessing, and transforming XML documents.
1 XML at a neighborhood university near you Innovation 2005 September 16, 2005 Kwok-Bun Yue University of Houston-Clear Lake.
Java WWW Week 10 Version 2.1 Mar 2008 Slide Java (JSP) and XML  Format of lecture: What is XML? A sample XML file… How to use.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
Intro to XML Originally Presented by Clifford Lemoine Modified by Box.
File Management Android Club Agenda Working with files Networking XML JSON.
Utilizing XML in ColdFusion MX by Attila Domokos.
The Main Routine In these notes I call it DataImporter. It contains: A main routine the creates an instance of IndexerData, the root of our data model.
Date : 3/3/2010 Web Technology Solutions Class: Application Syndication: Parse and Publish RSS & XML Data.
Web Services with Apache CXF Part 2: JAXB and WSDL to Java Robert Thornton.
Countries Websites CIA world fact book Worldatlas.com National Geographic.
Sheet 1XML Technology in E-Commerce 2001Lecture 3 XML Technology in E-Commerce Lecture 3 DOM and SAX.
Consuming eXtensible Markup Language (XML) feeds.
Data collections Android Club Agenda Array ArrayList HashMap.
Consuming eXtensible Markup Language (XML) feeds.
School of Computing and Information Systems CS 371 Web Application Programming XML and JSON Encoding Data.
Web Services with Apache CXF Part 2: JAXB and WSDL to Java Robert Thornton.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
Document Object Model DOM. Agenda l Introduction to DOM l Java API for XML Parsing (JAXP) l Installation and setup l Steps for DOM parsing l Example –Representing.
JSON Android Club 2015.
XML. DCS – SWC 2 Data vs. Information We often use the terms data and information interchangeably More precisely, data is some ”value” of a certain type,
Schema Data Processing
1 JAXP & XPATH. Objectives 2  XPath  JAXP Processing of XPath  Workshops.
Condition & loop Android Club Agenda if/else Switch Loops.
XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
Web services. DOM parsing and SOAP.. Summary. ● Exercise: SAX-Based checkInvoice(), ● push parsing, ● event-based parsing, ● traversal order is depth-first.
Martin Kruliš by Martin Kruliš (v1.1)1.
XML. RHS – SOC 2 Data vs. Information We often use the terms data and information interchangeably More precisely, data is some ”value” of a certain type,
Copyright 2007 Byrne Reese. Distributed under Creative Commons, share and share alike with attribution. Intermediate Perl Programming Class Five Instructor:
13-Mar-16 DOM. 2 Difference between SAX and DOM DOM reads the entire XML document into memory and stores it as a tree data structure SAX reads the XML.
Hashmap, date, exception Android Club Agenda Hashmap Date Exception handling.
Chapter 26 XML. Chapter Goals Understanding XML elements and attributes Understanding the concept of an XML parser Being able to read and write XML documents.
USING ANDROID WITH THE DOM. Slide 2 Lecture Summary DOM concepts SAX vs DOM parsers Parsing HTTP results The Android DOM implementation.
XML & JSON. Background XML and JSON are to standard, textual data formats for representing arbitrary data – XML stands for “eXtensible Markup Language”
XML. Contents  Parsing an XML Document  Validating XML Documents.
Countries and capitals memory game Go to the answers.
{ XML Technologies } BY: DR. M’HAMED MATAOUI
Chapter 24 XML.
Java/XML.
{ XML Technologies } BY: DR. M’HAMED MATAOUI
More DOM 13-Nov-18.
Introduction to Web programming
More DOM 28-Nov-18.
WaysInJavaToParseXML
More DOM.
CS 240 – Advanced Programming Concepts
XML document processing in Java using XPath and XSLT
Countries and capitals memory game.
WaysInJavaToParseXML
Presentation transcript:

XML Android Club 2015

Agenda XML JSON

XML eXtensible Markup Language Used for: data transfer PHP -> Java

XML: example

Uzbekistan Tashkent Sum

XML: practice Add following countries: Russia – Moscow – Ruble China – Beijing – Yuan Japan – Tokyo – Yen US – Washington – US Dollar Germany – Berlin - Euro

XML Parsing (разобрать) DOM JDOM StAX JAXB Lynda.com - XML Integration with Java

Android XML parsers DOM SAX XmlPullParser

DOM: example DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(" ml/simple.xml");

DOM: example NodeList list = doc.getElementsByTagName("food"); for (int i = 0; i < list.getLength(); i++) { Element element = (Element) list.item(i); String value = element.getElementsByTagName("name").item(0 ).getTextContent(); System.out.println(value); }

DOM: practice Create DocumentBuilderFactory Create DocumentBuilder Create Document -> use before stated URL Get node list Print country names

DOM: practice (cont) Print: [CAPITAL] is capital city of [COUNTRY] Example: Tashkent is capital city of Uzbekistan

DOM: practice 2 Create DocumentBuilderFactory Create DocumentBuilder Create Document -> use before stated URL Get node list Print book titles

POJO Plain old java object

XML - example Belgian Waffles $5.95 Two of our famous Belgian Waffles with plenty of real maple syrup 650

POJO - example String name; String price; String description; int calories; Getters + setters

XML parsing: example List foodList = new ArrayList<>(); Food food = new Food(); food.setName(name); food.setDescription(description); food.setPrice(price); food.setCalories(Integer.parseInt(calories)); foodList.add(food);

POJO - practice Create list of country POJOs Print amount of countries using POJO list

POJO – practice 2 Create list of books POJOs Print amount of books

FINAL PRACTICE Create DocumentBuilderFactory Create DocumentBuilder Create Document Create node list Using node list parse XML to POJOs list Print names: firstname+lastname

Questions? Do you have questions?

Review Chapter 10: File management

Next lesson Tic Tac Toe

Test: June 29th Warmup-1 & Warmup-2 10%+10% String-1 & String-2 10%+10% Array-1 & Array-2 10%+10% Logic-1 & Logic-2 10%+10% Project Euler 1 problem from % 8*10%+1*20%=100% Next month will be FREE!

Thank you Thank you for your attention!