To accomplish the parsing, we are going to use a SAX-Parser (Wiki-Info). SAX stands for "Simple API for XML", so it is perfect for us

Size: px
Start display at page:

Download "To accomplish the parsing, we are going to use a SAX-Parser (Wiki-Info). SAX stands for "Simple API for XML", so it is perfect for us"

Transcription

1 Description: 0.) In this tutorial we are going to parse the following XML-File located at the following url: : XML: <?xml version="1.0"?> <outertag> <innertag sampleattribute="innertagattribute"> <mytag> anddev.org rulez =) </mytag> <tagwithnumber thenumber="1337"/> </innertag> </outertag> To accomplish the parsing, we are going to use a SAX-Parser (Wiki-Info). SAX stands for "Simple API for XML", so it is perfect for us 1.) Lets take a look at the oncreate(...)-method. It will open an URL, create a SAXParser, add a ContentHandler to it, parse the URL and display the Results in a TextView. /** Called when the activity is first created. */ public void oncreate(bundle icicle) { super.oncreate(icicle); /* Create a new TextView to display the parsingresult later. */ TextView tv = new TextView(this); try { /* Create a URL we want to load some xml-data from. */ URL url = new URL(" /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newsaxparser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getxmlreader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myexamplehandler = new ExampleHandler(); xr.setcontenthandler(myexamplehandler);

2 /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ /* Our ExampleHandler now provides the parsed data to us. */ ParsedExampleDataSet parsedexampledataset = myexamplehandler.getparseddata(); /* Set the result to be displayed in our GUI. */ tv.settext(parsedexampledataset.tostring()); catch (Exception e) { /* Display any Error to the GUI. */ tv.settext("error: " + e.getmessage()); Log.e(MY_DEBUG_TAG, "WeatherQueryError", e); /* Display the TextView. */ this.setcontentview(tv); 2.) The next Class to take a look at is the ExampleHandler which extends org.xml.sax.helpers.defaulthandler. A SAX-Handler is an really easy class. We will just need to implement some trivial functions. The SAXParser will 'walk' through the XML-File from the beginning to the end and always, when it reaches an opening tag like: XML: <outertag> the Handler-Function: public void startelement(string namespaceuri, String localname, String qname, Attributes atts) throws SAXException { gets called. Where in this case localname will be "outertag". The same happens on closing tags, like: XML: </outertag>

3 Here the equivalent 'closing'-method that gets called: public void endelement(string namespaceuri, String localname, String qname) throws SAXException { In XML you can put any characters you want between a opening and an closing tag, like this: XML: <mytag> anddev.org rulez =) </mytag> When the Parser reaches such a Tag, the following method gets called, providing the characters between the opening and the closing tag: /** Gets be called on the following structure: * <tag>characters</tag> */ public void characters(char ch[], int start, int length) { String textbetween = new String(ch, start, length); Finally on the start/end of each document the following functions get called: public void startdocument() throws SAXException { Do some startup if needed public void enddocument() throws SAXException { Do some finishing work if needed 3.) What was shown up to here was just the basic structure of the SAX-Handler. Now I'll show you the standard way of a real-life Handler-Implementation. This is also pretty simple. We probably want to know how 'deep' the Parser has parsed so far, so we create some booleans indicating which tags are still open. This is done like the following:

4 Fields private boolean in_outertag = false; private boolean in_innertag = false; private boolean in_mytag = false; As we know, when the parser reaches an opening-tag the startelement(...)-method gets called: So we will simply check the localname and set the corresponding "in_xyz"-boolean to true. public void startelement(string namespaceuri, String localname, String qname, Attributes atts) throws SAXException { if (localname.equals("outertag")) { this.in_outertag = true; else if (localname.equals("innertag")) { this.in_innertag = true; else if (localname.equals("mytag")) { this.in_mytag = true; else if (localname.equals("tagwithnumber")) { String attrvalue = atts.getvalue("thenumber"); int i = Integer.parseInt(attrValue); myparsedexampledataset.setextractedint(i); Similiar on closing tags the endelement(..)-method gets called and we just set the "in_xyz"-boolean back to false: public void endelement(string namespaceuri, String localname, String qname) throws SAXException { if (localname.equals("outertag")) { this.in_outertag = false; else if (localname.equals("innertag")) { this.in_innertag = false;

5 else if (localname.equals("mytag")) { this.in_mytag = false; else if (localname.equals("tagwithnumber")) { Nothing to do here So for example when the Parser reaches the following part: XML: <mytag> anddev.org rulez =) </mytag> Our "in_xyz"-booleans indicate in which tag these characters have been 'detected' and easily extract them: /** Gets be called on the following structure: * <tag>characters</tag> */ public void characters(char ch[], int start, int length) { if(this.in_mytag){ myparsedexampledataset.setextractedstring(new String(ch, start, length)); 4.) What I prefer is to make the Handler create a nice object that gets created during the whole parsing and when parsing has finished I can simply grab the created Object: public ParsedExampleDataSet getparseddata() { return this.myparsedexampledataset; So now you know how to properly use the SAXParser together with the SAXHandler If any question remained feel free to ask The Full Source: "/src/your_package_structure/parsingxml.java"

6 package org.anddev.android.parsingxml; import java.net.url; import javax.xml.parsers.saxparser; import javax.xml.parsers.saxparserfactory; import org.xml.sax.inputsource; import org.xml.sax.xmlreader; import android.app.activity; import android.os.bundle; import android.util.log; import android.widget.textview; public class ParsingXML extends Activity { private final String MY_DEBUG_TAG = "WeatherForcaster"; /** Called when the activity is first created. */ public void oncreate(bundle icicle) { super.oncreate(icicle); /* Create a new TextView to display the parsingresult later. */ TextView tv = new TextView(this); try { /* Create a URL we want to load some xml-data from. */ URL url = new URL(" /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newsaxparser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getxmlreader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myexamplehandler = new ExampleHandler(); xr.setcontenthandler(myexamplehandler); /* Parse the xml-data from our URL. */

7 xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ /* Our ExampleHandler now provides the parsed data to us. */ ParsedExampleDataSet parsedexampledataset = myexamplehandler.getparseddata(); /* Set the result to be displayed in our GUI. */ tv.settext(parsedexampledataset.tostring()); catch (Exception e) { /* Display any Error to the GUI. */ tv.settext("error: " + e.getmessage()); Log.e(MY_DEBUG_TAG, "WeatherQueryError", e); /* Display the TextView. */ this.setcontentview(tv); "/src/your_package_structure/examplehandler.java" package org.anddev.android.parsingxml; import org.xml.sax.attributes; import org.xml.sax.saxexception; import org.xml.sax.helpers.defaulthandler; public class ExampleHandler extends DefaultHandler{ Fields private boolean in_outertag = false; private boolean in_innertag = false; private boolean in_mytag = false; private ParsedExampleDataSet myparsedexampledataset = new

8 ParsedExampleDataSet(); Getter & Setter public ParsedExampleDataSet getparseddata() { return this.myparsedexampledataset; Methods public void startdocument() throws SAXException { this.myparsedexampledataset = new ParsedExampleDataSet(); public void enddocument() throws SAXException { Nothing to do /** Gets be called on opening tags like: * <tag> * Can provide attribute(s), when xml was like: * <tag attribute="attributevalue">*/ public void startelement(string namespaceuri, String localname, String qname, Attributes atts) throws SAXException { if (localname.equals("outertag")) { this.in_outertag = true; else if (localname.equals("innertag")) { this.in_innertag = true; else if (localname.equals("mytag")) { this.in_mytag = true; else if (localname.equals("tagwithnumber")) { Extract an Attribute String attrvalue = atts.getvalue("thenumber"); int i = Integer.parseInt(attrValue);

9 myparsedexampledataset.setextractedint(i); /** Gets be called on closing tags like: * </tag> */ public void endelement(string namespaceuri, String localname, String qname) throws SAXException { if (localname.equals("outertag")) { this.in_outertag = false; else if (localname.equals("innertag")) { this.in_innertag = false; else if (localname.equals("mytag")) { this.in_mytag = false; else if (localname.equals("tagwithnumber")) { Nothing to do here /** Gets be called on the following structure: * <tag>characters</tag> */ public void characters(char ch[], int start, int length) { if(this.in_mytag){ myparsedexampledataset.setextractedstring(new String(ch, start, length)); "/src/your_package_structure/parsedexampledataset.java" package org.anddev.android.parsingxml; public class ParsedExampleDataSet { private String extractedstring = null; private int extractedint = 0; public String getextractedstring() { return extractedstring; public void setextractedstring(string extractedstring) {

10 this.extractedstring = extractedstring; public int getextractedint() { return extractedint; public void setextractedint(int extractedint) { this.extractedint = extractedint; public String tostring(){ return "ExtractedString = " + this.extractedstring + "\nextractedint = " + this.extractedint;

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

MANAGING INFORMATION (CSCU9T4) LECTURE 4: XML AND JAVA 1 - SAX

MANAGING INFORMATION (CSCU9T4) LECTURE 4: XML AND JAVA 1 - SAX MANAGING INFORMATION (CSCU9T4) LECTURE 4: XML AND JAVA 1 - SAX Gabriela Ochoa http://www.cs.stir.ac.uk/~nve/ RESOURCES Books XML in a Nutshell (2004) by Elliotte Rusty Harold, W. Scott Means, O'Reilly

More information

Simple API for XML (SAX)

Simple API for XML (SAX) Simple API for XML (SAX) Asst. Prof. Dr. Kanda Runapongsa (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Topics Parsing and application SAX event model SAX event handlers Apache

More information

COMP4317: XML & Database Tutorial 2: SAX Parsing

COMP4317: XML & Database Tutorial 2: SAX Parsing COMP4317: XML & Database Tutorial 2: SAX Parsing Week 3 Thang Bui @ CSE.UNSW SAX Simple API for XML is NOT a W3C standard. SAX parser sends events on-the-fly startdocument event enddocument event startelement

More information

Handling SAX Errors. <coll> <seqment> <title PMID="xxxx">title of doc 1</title> text of document 1 </segment>

Handling SAX Errors. <coll> <seqment> <title PMID=xxxx>title of doc 1</title> text of document 1 </segment> Handling SAX Errors James W. Cooper You re charging away using some great piece of code you wrote (or someone else wrote) that is making your life easier, when suddenly plotz! boom! The whole thing collapses

More information

Needed for: domain-specific applications implementing new generic tools Important components: parsing XML documents into XML trees navigating through

Needed for: domain-specific applications implementing new generic tools Important components: parsing XML documents into XML trees navigating through Chris Panayiotou Needed for: domain-specific applications implementing new generic tools Important components: parsing XML documents into XML trees navigating through XML trees manipulating XML trees serializing

More information

XML in the Development of Component Systems. Parser Interfaces: SAX

XML in the Development of Component Systems. Parser Interfaces: SAX XML in the Development of Component Systems Parser Interfaces: SAX XML Programming Models Treat XML as text useful for interactive creation of documents (text editors) also useful for programmatic generation

More information

Welcome to: SAX Parser

Welcome to: SAX Parser Welcome to: SAX Parser Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 3.1 Unit Objectives After completing this unit, you should be able to: Describe

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

Accelerating SVG Transformations with Pipelines XML & SVG Event Pipelines Technologies Recommendations

Accelerating SVG Transformations with Pipelines XML & SVG Event Pipelines Technologies Recommendations Accelerating SVG Transformations with Pipelines XML & SVG Event Pipelines Technologies Recommendations Eric Gropp Lead Systems Developer, MWH Inc. SVG Open 2003 XML & SVG In the Enterprise SVG can meet

More information

Knowledge Engineering pt. School of Industrial and Information Engineering. Test 2 24 th July Part II. Family name.

Knowledge Engineering pt. School of Industrial and Information Engineering. Test 2 24 th July Part II. Family name. School of Industrial and Information Engineering Knowledge Engineering 2012 13 Test 2 24 th July 2013 Part II Family name Given name(s) ID 3 6 pt. Consider the XML language defined by the following schema:

More information

Introduction to XML. Large Scale Programming, 1DL410, autumn 2009 Cons T Åhs

Introduction to XML. Large Scale Programming, 1DL410, autumn 2009 Cons T Åhs Introduction to XML Large Scale Programming, 1DL410, autumn 2009 Cons T Åhs XML Input files, i.e., scene descriptions to our ray tracer are written in XML. What is XML? XML - extensible markup language

More information

extensible Markup Language (XML) Announcements Sara Sprenkle August 1, 2006 August 1, 2006 Assignment 6 due Thursday Project 2 due next Wednesday

extensible Markup Language (XML) Announcements Sara Sprenkle August 1, 2006 August 1, 2006 Assignment 6 due Thursday Project 2 due next Wednesday extensible Markup Language (XML) Sara Sprenkle Announcements Assignment 6 due Thursday Project 2 due next Wednesday Quiz TA Evaluation Sara Sprenkle - CISC370 2 1 Using the Synchronized Keyword Can use

More information

SAX & DOM. Announcements (Thu. Oct. 31) SAX & DOM. CompSci 316 Introduction to Database Systems

SAX & DOM. Announcements (Thu. Oct. 31) SAX & DOM. CompSci 316 Introduction to Database Systems SAX & DOM CompSci 316 Introduction to Database Systems Announcements (Thu. Oct. 31) 2 Homework #3 non-gradiance deadline extended to next Thursday Gradiance deadline remains next Tuesday Project milestone

More information

core programming Simple API for XML SAX Marty Hall, Larry Brown

core programming Simple API for XML SAX Marty Hall, Larry Brown core programming Simple API for XML SAX 1 2001-2003 Marty Hall, Larry Brown http:// 2 SAX Agenda Introduction to SAX Installation and setup Steps for SAX parsing Defining a content handler Examples Printing

More information

Databases and Information Systems 1

Databases and Information Systems 1 Databases and Information Systems 7. XML storage and core XPath implementation 7.. Mapping XML to relational databases and Datalog how to store an XML document in a relation database? how to answer XPath

More information

Written Exam XML Winter 2005/06 Prof. Dr. Christian Pape. Written Exam XML

Written Exam XML Winter 2005/06 Prof. Dr. Christian Pape. Written Exam XML Name: Matriculation number: Written Exam XML Max. Points: Reached: 9 20 30 41 Result Points (Max 100) Mark You have 60 minutes. Please ask immediately, if you do not understand something! Please write

More information

Databases and Information Systems XML storage in RDBMS and core XPath implementation. Prof. Dr. Stefan Böttcher

Databases and Information Systems XML storage in RDBMS and core XPath implementation. Prof. Dr. Stefan Böttcher Databases and Information Systems 1 8. XML storage in RDBMS and core XPath implementation Prof. Dr. Stefan Böttcher XML storage and core XPath implementation 8.1. XML in commercial DBMS 8.2. Mapping XML

More information

Making XT XML capable

Making XT XML capable Making XT XML capable Martin Bravenboer mbravenb@cs.uu.nl Institute of Information and Computing Sciences University Utrecht The Netherlands Making XT XML capable p.1/42 Introduction Making XT XML capable

More information

SAX Reference. The following interfaces were included in SAX 1.0 but have been deprecated:

SAX Reference. The following interfaces were included in SAX 1.0 but have been deprecated: G SAX 2.0.2 Reference This appendix contains the specification of the SAX interface, version 2.0.2, some of which is explained in Chapter 12. It is taken largely verbatim from the definitive specification

More information

JAXP: Beyond XML Processing

JAXP: Beyond XML Processing JAXP: Beyond XML Processing Bonnie B. Ricca Sun Microsystems bonnie.ricca@sun.com bonnie@bobrow.net Bonnie B. Ricca JAXP: Beyond XML Processing Page 1 Contents Review of SAX, DOM, and XSLT JAXP Overview

More information

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name EXAM IN SEMI-STRUCTURED DATA 184.705 23. 10. 2015 Study Code Student Id Family Name First Name Working time: 100 minutes. Exercises have to be solved on this exam sheet; Additional slips of paper will

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Information Technology IT6801 SERVICE ORIENTED ARCHITECTURE Anna University 2 & 16 Mark Questions & Answers Year / Semester: IV / VII Regulation:

More information

languages for describing grammar and vocabularies of other languages element: data surrounded by markup that describes it

languages for describing grammar and vocabularies of other languages element: data surrounded by markup that describes it XML and friends history/background GML (1969) SGML (1986) HTML (1992) World Wide Web Consortium (W3C) (1994) XML (1998) core language vocabularies, namespaces: XHTML, RSS, Atom, SVG, MathML, Schema, validation:

More information

Force.com Streaming API Developer's Guide

Force.com Streaming API Developer's Guide Force.com Streaming API Developer's Guide Version 34.0, Summer 15 @salesforcedocs Last updated: June 30, 2015 Copyright 2000 2015 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark

More information

Processing XML Documents with SAX Using BSF4ooRexx

Processing XML Documents with SAX Using BSF4ooRexx MIS Department Processing XML Documents with SAX Using BSF4ooRexx 2013 International Rexx Symposium RTP, North Carolina Prof. Dr. Rony G. Flatscher Vienna University of Economics and Business Administration

More information

Written Exam XML Summer 06 Prof. Dr. Christian Pape. Written Exam XML

Written Exam XML Summer 06 Prof. Dr. Christian Pape. Written Exam XML Name: Matriculation number: Written Exam XML Max. Points: Reached: 9 20 30 41 Result Points (Max 100) Mark You have 60 minutes. Please ask immediately, if you do not understand something! Please write

More information

Database.com Streaming API Developer's Guide

Database.com Streaming API Developer's Guide Version 25.0: Summer 12 Database.com Streaming API Developer's Guide Last updated: September 1 2012 Copyright 2000 2012 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark

More information

REFACTORING FRAMENET FOR EFFICIENT RELATIONAL QUERIES. Zeeshan Asim Ahmad, B.S. Problem in Lieu of Thesis Prepared for the Degree of MASTER OF SCIENCE

REFACTORING FRAMENET FOR EFFICIENT RELATIONAL QUERIES. Zeeshan Asim Ahmad, B.S. Problem in Lieu of Thesis Prepared for the Degree of MASTER OF SCIENCE REFACTORING FRAMENET FOR EFFICIENT RELATIONAL QUERIES Zeeshan Asim Ahmad, B.S. Problem in Lieu of Thesis Prepared for the Degree of MASTER OF SCIENCE UNIVERSITY OF NORTH TEXAS December 2003 APPROVED: Paul

More information

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

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name EXAM IN SEMI-STRUCTURED DATA 184.705 24. 6. 2015 Study Code Student Id Family Name First Name Working time: 100 minutes. Exercises have to be solved on this exam sheet; Additional slips of paper will not

More information

Apache Xerces is a Java-based processor that provides standard interfaces and implementations for DOM, SAX and StAX XML parsing API standards.

Apache Xerces is a Java-based processor that provides standard interfaces and implementations for DOM, SAX and StAX XML parsing API standards. i About the Tutorial Apache Xerces is a Java-based processor that provides standard interfaces and implementations for DOM, SAX and StAX XML parsing API standards. This tutorial will teach you the basic

More information

The Book of SAX The Simple API for XML

The Book of SAX The Simple API for XML The Simple API for XML W. Scott Means, Michael A. Bodie Publisher: No Starch Press Frist Edition June 15th 2002 ISBN: 1886411778, 293 pages A tutorial and reference for SAX, the Simple API for XML. Written

More information

Part V. SAX Simple API for XML

Part V. SAX Simple API for XML Part V SAX Simple API for XML Torsten Grust (WSI) Database-Supported XML Processors Winter 2012/13 76 Outline of this part 1 SAX Events 2 SAX Callbacks 3 SAX and the XML Tree Structure 4 Final Remarks

More information

Part V. SAX Simple API for XML. Torsten Grust (WSI) Database-Supported XML Processors Winter 2008/09 84

Part V. SAX Simple API for XML. Torsten Grust (WSI) Database-Supported XML Processors Winter 2008/09 84 Part V SAX Simple API for XML Torsten Grust (WSI) Database-Supported XML Processors Winter 2008/09 84 Outline of this part 1 SAX Events 2 SAX Callbacks 3 SAX and the XML Tree Structure 4 SAX and Path Queries

More information

Applied Databases. Sebastian Maneth. Lecture 4 SAX Parsing, Entity Relationship Model. University of Edinburgh - January 21st, 2016

Applied Databases. Sebastian Maneth. Lecture 4 SAX Parsing, Entity Relationship Model. University of Edinburgh - January 21st, 2016 Applied Databases Lecture 4 SAX Parsing, Entity Relationship Model Sebastian Maneth University of Edinburgh - January 21st, 2016 2 Outline 1. SAX Simple API for XML 2. Comments wrt Assignment 1 3. Data

More information

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

XML Parsers. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University XML Parsers Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Overview What are XML Parsers? Programming Interfaces of XML Parsers DOM:

More information

Database.com Streaming API Developer's Guide

Database.com Streaming API Developer's Guide Version 30.0: Spring 14 Database.com Streaming API Developer's Guide Last updated: May 5, 2014 Copyright 2000 2014 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of

More information

XML Master: Professional V2

XML Master: Professional V2 XML I10-002 XML Master: Professional V2 Version: 4.0 QUESTION NO: 1 Which of the following correctly describes the DOM (Level 2) Node interface? A. The Node interface can be used to change the value (nodevalue)

More information

XML Programming in Java

XML Programming in Java Mag. iur. Dr. techn. Michael Sonntag XML Programming in Java DOM, SAX XML Techniques for E-Commerce, Budapest 2005 E-Mail: sonntag@fim.uni-linz.ac.at http://www.fim.uni-linz.ac.at/staff/sonntag.htm Michael

More information

4 SAX. XML Application. SAX Parser. callback table. startelement! startelement() characters! 23

4 SAX. XML Application. SAX Parser. callback table. startelement! startelement() characters! 23 4 SAX SAX 23 (Simple API for XML) is, unlike DOM, not a W3C standard, but has been developed jointly by members of the XML-DEV mailing list (ca. 1998). SAX processors use constant space, regardless of

More information

XML (Extensible Markup Language) JAXP (Java API for XML Processing) Presented by Bartosz Sakowicz

XML (Extensible Markup Language) JAXP (Java API for XML Processing) Presented by Bartosz Sakowicz XML (Extensible Markup Language) JAXP (Java API for XML Processing) Presented by Bartosz Sakowicz Overview of XML XML is a text-based markup language that is fast becoming the standard for data interchange

More information

xmlreader & xmlwriter Marcus Börger

xmlreader & xmlwriter Marcus Börger xmlreader & xmlwriter Marcus Börger PHP Quebec 2006 Marcus Börger SPL - Standard PHP Library 2 xmlreader & xmlwriter Brief review of SimpleXML/DOM/SAX Introduction of xmlreader Introduction of xmlwriter

More information

XML An API Persepctive. Context. Overview

XML An API Persepctive. Context. Overview XML An API Persepctive Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu/~spring Context XML is designed to

More information

xmlreader & xmlwriter Marcus Börger

xmlreader & xmlwriter Marcus Börger xmlreader & xmlwriter Marcus Börger PHP tek 2006 Marcus Börger xmlreader/xmlwriter 2 xmlreader & xmlwriter Brief review of SimpleXML/DOM/SAX Introduction of xmlreader Introduction of xmlwriter Marcus Börger

More information

Basics of programming 3. Structured data representations

Basics of programming 3. Structured data representations Basics of programming 3 Structured data representations Introduction Objects are in memory how to transfer them how to store them in files Structured representations Serialization XML JSON Basics of programming

More information

Marco Ronchetti - Java XML parsing J0 1

Marco Ronchetti - Java XML parsing J0 1 Java XML parsing 1 2 Tree-based vs Event-based API Tree-based API A tree-based API compiles an XML document into an internal tree structure. This makes it possible for an application program to navigate

More information

EVALUATION COPY. Contents. Unauthorized reproduction or distribution is prohibited. Advanced Java Programming

EVALUATION COPY. Contents. Unauthorized reproduction or distribution is prohibited. Advanced Java Programming Contents Chapter 1 - Course Introduction... 9 Course Objectives... 10 Course Overview... 12 Using the Workbook... 13 Suggested References... 14 Chapter 2 - Processing XML with Java JAXP... 17 The Java

More information

EECS 595 PROJECT DETERMINING THE AGE OF AN AUTHOR IN A CHATROOM

EECS 595 PROJECT DETERMINING THE AGE OF AN AUTHOR IN A CHATROOM EECS 595 PROJECT DETERMINING THE AGE OF AN AUTHOR IN A CHATROOM MATTHEW CONLEN 1. Introduction This document describes an implementation of age detection in chat that is based upon several previous papers.

More information

Copyright 2007, 2001, 2000 O Reilly Media, Inc. All rights reserved. Printed in the United States of America.

Copyright 2007, 2001, 2000 O Reilly Media, Inc. All rights reserved. Printed in the United States of America. Java & XML by Brett D. McLaughlin and Justin Edelson Copyright 2007, 2001, 2000 O Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O Reilly Media, Inc., 1005

More information

1 <?xml encoding="utf-8"?> 1 2 <bubbles> 2 3 <!-- Dilbert looks stunned --> 3

1 <?xml encoding=utf-8?> 1 2 <bubbles> 2 3 <!-- Dilbert looks stunned --> 3 4 SAX SAX Simple API for XML 4 SAX Sketch of SAX s mode of operations SAX 7 (Simple API for XML) is, unlike DOM, not a W3C standard, but has been developed jointly by members of the XML-DEV mailing list

More information

SAX Simple API for XML

SAX Simple API for XML 4. SAX SAX Simple API for XML SAX 7 (Simple API for XML) is, unlike DOM, not a W3C standard, but has been developed jointly by members of the XML-DEV mailing list (ca. 1998). SAX processors use constant

More information

BlackBerry Development (for Web Developers) Kevin Falcone

BlackBerry Development (for Web Developers) Kevin Falcone BlackBerry Development (for Web Developers) Kevin Falcone kevin@jibsheet.com Perl developer Request Tracker Hiveminder BlackBerry owner Severely lapsed Java programmer Hiveminder has an API json xml It

More information

Processing XML with Java. XML Examples. Parsers. XML-Parsing Standards. XML Tree Model. Representation and Management of Data on the Internet

Processing XML with Java. XML Examples. Parsers. XML-Parsing Standards. XML Tree Model. Representation and Management of Data on the Internet Parsers Processing XML with Java Representation and Management of Data on the Internet What is a parser? - A program that analyses the grammatical structure of an input, with respect to a given formal

More information

Web Data Management. Tree Pattern Evaluation. Philippe Rigaux CNAM Paris & INRIA Saclay

Web Data Management. Tree Pattern Evaluation. Philippe Rigaux CNAM Paris & INRIA Saclay http://webdam.inria.fr/ Web Data Management Tree Pattern Evaluation Serge Abiteboul INRIA Saclay & ENS Cachan Ioana Manolescu INRIA Saclay & Paris-Sud University Philippe Rigaux CNAM Paris & INRIA Saclay

More information

Consuming SharePoint Web Services with SAP Web Dynpro using the Adaptive Web Services Model

Consuming SharePoint Web Services with SAP Web Dynpro using the Adaptive Web Services Model Consuming SharePoint Web Services with SAP Web Dynpro using the Adaptive Web Services Model Applies to: NetWeaver 7.0 SP 06, SAP Web Dynpro for Java, Microsoft Office SharePoint Server 2007. Summary Interoperability

More information

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. 1 Thread A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. Each virtual machine instance has at least one main

More information

Code Examples Using Java ME Technology and New Web 2.0 Services (Beyond Google Maps)

Code Examples Using Java ME Technology and New Web 2.0 Services (Beyond Google Maps) Code Examples Using Java ME Technology and New Web 2.0 Services (Beyond Google Maps) Hinkmond Wong Sr. Staff Engineer Sun Microsystems, Inc. https://j2me-cdc.dev.java.net/ TS-1302 Copyright 2006, Sun Microsystems

More information

XML Development Using Borland JBuilder 8

XML Development Using Borland JBuilder 8 XML Development Using Borland JBuilder 8 Jumpstart XML development with the Apache XML framework, supported in JBuilder 8 A Borland White Paper Kathy L. Alexion, Systems Engineer January 2003 Contents

More information

Systems Programming. 05. Structures & Trees. Alexander Holupirek

Systems Programming. 05. Structures & Trees. Alexander Holupirek Systems Programming 05. Structures & Trees Alexander Holupirek Database and Information Systems Group Department of Computer & Information Science University of Konstanz Summer Term 2008 Schedule for Today

More information

Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard.

Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard. 44 CHAPTER 2 Android s development environment Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard. TIP You ll want the package name of your applications to be unique

More information

XML Overview, part 1

XML Overview, part 1 XML Overview, part 1 Norman Gray Revision 1.4, 2002/10/30 XML Overview, part 1 p.1/28 Contents The who, what and why XML Syntax Programming with XML Other topics The future http://www.astro.gla.ac.uk/users/norman/docs/

More information

Static Analysis for Event-Based XML Processing

Static Analysis for Event-Based XML Processing Static Analysis for Event-Based XML Processing Anders Møller Department of Computer Science University of Aarhus amoeller@bricsdk Abstract Event-based processing of XML data as exemplified by the popular

More information

EXIP - Embeddable EXI implementation in C EXIP USER GUIDE. December 11, Rumen Kyusakov PhD student, Luleå University of Technology

EXIP - Embeddable EXI implementation in C EXIP USER GUIDE. December 11, Rumen Kyusakov PhD student, Luleå University of Technology EXIP - Embeddable EXI implementation in C EXIP USER GUIDE December 11, 2011 Rumen Kyusakov PhD student, Luleå University of Technology Copyright (c) 2011, Rumen Kyusakov. This work is licensed under Creative

More information

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World Before you do anything read all of the following red paragraph! For this lab you

More information

Object-Oriented Programming Design Topic : Exception Programming

Object-Oriented Programming Design Topic : Exception Programming Electrical and Computer Engineering Object-Oriented Topic : Exception Maj Joel Young Joel.Young@afit.edu 18-Sep-03 Maj Joel Young Error Handling General error handling options Notify the user, and Return

More information

XBinder. XML Schema Compiler Version 1.4 C EXI Runtime Reference Manual

XBinder. XML Schema Compiler Version 1.4 C EXI Runtime Reference Manual XBinder XML Schema Compiler Version 1.4 C EXI Runtime Reference Manual Objective Systems, Inc. October 2008 The software described in this document is furnished under a license agreement and may be used

More information

CS193j, Stanford Handout #25. Exceptions

CS193j, Stanford Handout #25. Exceptions CS193j, Stanford Handout #25 Summer, 2003 Manu Kumar Exceptions Great Exceptations Here we'll cover the basic features and uses of exceptions. Pre-Exceptions A program has to encode two ideas -- how to

More information

Development of an Interface and Visualization Components for a Text-to-Scene Converter

Development of an Interface and Visualization Components for a Text-to-Scene Converter Development of an Interface and Visualization Components for a Text-to-Scene Converter Bastian Schulz Report of a study project during an exchange term at the Lunds Tekniska Högskolan (Sweden) written

More information

Android for Java Developers Dr. Markus Schmall, Jochen Hiller

Android for Java Developers Dr. Markus Schmall, Jochen Hiller Android for Java Developers Dr. Markus Schmall Jochen Hiller 1 Who we are Dr. Markus Schmall m.schmall@telekom.de Deutsche Telekom AG Jochen Hiller j.hiller@telekom.de Deutsche Telekom AG 2 Agenda Introduction

More information

The Road to Reactive with RxJava. Or: How to use non blocking I/O without wanting to kill yourself

The Road to Reactive with RxJava. Or: How to use non blocking I/O without wanting to kill yourself The Road to Reactive with RxJava Or: How to use non blocking I/O without wanting to kill yourself Legacy An accomplishment that remains relevant long after a person has died Software is not so lucky

More information

Practicing at the Cutting Edge Learning and Unlearning about Performance. Martin Thompson

Practicing at the Cutting Edge Learning and Unlearning about Performance. Martin Thompson Practicing at the Cutting Edge Learning and Unlearning about Performance Martin Thompson - @mjpt777 Learning and Unlearning 1. Brief History of Java 2. Evolving Design approach 3. An evolving Hardware

More information

JAVA XML PARSING SPECIFICATION

JAVA XML PARSING SPECIFICATION JAVA XML PARSING SPECIFICATION Joona Palaste Abstract: XML is a mark-up lanuae, or more precisely, a definition of mark-up lanuaes which allows information of arbitrary kind to be accurately and hierarchically

More information

COMP4521 EMBEDDED SYSTEMS SOFTWARE

COMP4521 EMBEDDED SYSTEMS SOFTWARE COMP4521 EMBEDDED SYSTEMS SOFTWARE LAB 1: DEVELOPING SIMPLE APPLICATIONS FOR ANDROID INTRODUCTION Android is a mobile platform/os that uses a modified version of the Linux kernel. It was initially developed

More information

Importing MusicXML files into Max/MSP

Importing MusicXML files into Max/MSP Importing MusicXML files into Max/MSP Technical Report: UL-CSIS-07-01 Keith Mullins & Margaret Cahill Centre for Computational Musicology and Computer Music Department of Computer Science and Information

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

SILVERPOP API - IMPORTLIST

SILVERPOP API - IMPORTLIST SILVERPOP API - IMPORTLIST June 11, 2015 OVERVIEW 1. Project Background This is an article in a series that can be found at: http://c-l-associates.com/home/silverpop. We are going to do our first real

More information

"mark up" documents with human-readable tags content is separate from description of content not limited to describing visual appearance

mark up documents with human-readable tags content is separate from description of content not limited to describing visual appearance XML and friends history/background GML (1969) SGML (1986) HTML (1992) World Wide Web Consortium (W3C) (1994) XML (1998) core language vocabularies, namespaces XHTML, SVG, MathML, Schema, validation Schema,

More information

Tutorial. Interactive Forms Integration into Web Dynpro for Java Topic: Working with the PdfObject API

Tutorial. Interactive Forms Integration into Web Dynpro for Java Topic: Working with the PdfObject API Tutorial Interactive Forms Integration into Web Dynpro for Java Topic: Working with the PdfObject API At the conclusion of this tutorial, you will be able to: Generate PDF forms and fill them with XML

More information

ASN1C. ASN.1 Compiler Version 6.4 Java User s Guide

ASN1C. ASN.1 Compiler Version 6.4 Java User s Guide ASN1C ASN.1 Compiler Version 6.4 Java User s Guide Objective Systems, Inc. February 2011 The software described in this document is furnished under a license agreement and may be used only in accordance

More information

Android - JSON Parser Tutorial

Android - JSON Parser Tutorial Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file

More information

Web Technologies. XML data processing (II) SAX (Simple API for XML) XML document simplified processing. Dr. Sabin Buraga profs.info.uaic.

Web Technologies. XML data processing (II) SAX (Simple API for XML) XML document simplified processing. Dr. Sabin Buraga profs.info.uaic. Web Technologies XML data processing (II) SAX (Simple API for XML) XML document simplified processing Before asking new questions, think if you really want to know the response to them. Gene Wolfe Are

More information

Database Development In Android Applications

Database Development In Android Applications ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Database Development In Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran

More information

EMBEDDED SYSTEMS PROGRAMMING Android NDK

EMBEDDED SYSTEMS PROGRAMMING Android NDK EMBEDDED SYSTEMS PROGRAMMING 2014-15 Android NDK WHAT IS THE NDK? The Android NDK is a set of cross-compilers, scripts and libraries that allows to embed native code into Android applications Native code

More information

Chapter. Reading XML. InputStreams and Readers

Chapter. Reading XML. InputStreams and Readers Chapter 5 Reading XML Writing XML documents is very straightforward, as I hope Chapters 3 and 4 proved. Reading XML documents is not nearly as simple. Fortunately, you don t have to do all the work yourself;

More information

Intro to Android Development 3. Accessibility Capstone Dec 10, 2010

Intro to Android Development 3. Accessibility Capstone Dec 10, 2010 Intro to Android Development 3 Accessibility Capstone Dec 10, 2010 Using Web Services HTTP Request HTTP Response Using Web Services HTTP Request HTTP Response webserver some program Why use a web service?

More information

Composing Transformations of Compiled Java Programs with Jabyce

Composing Transformations of Compiled Java Programs with Jabyce UDC 681.3.064 Composing Transformations of Compiled Java Programs with Jabyce Romain Lenglet, Thierry Coupaye, and Eric Bruneton France Telecom R&D Division 28 chemin du Vieux Chêne, 38243 Meylan, France

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

Validate Inside Your Program with Schemas

Validate Inside Your Program with Schemas 29837 01 pp001-288 r9ah.ps 8/18/03 4:40 PM Page 203 Item 37 Validate Inside Your Program with Schemas 203 Item 37 Validate Inside Your Program with Schemas Rigorously testing preconditions is an important

More information

Our First Android Application

Our First Android Application Mobile Application Development Lecture 04 Imran Ihsan Our First Android Application Even though the HelloWorld program is trivial in introduces a wealth of new ideas the framework, activities, manifest,

More information

SMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0

SMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 SMAATSDK NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 NFC Module on Android Requirements and Documentation Table of contents Scope...3 Purpose...3 General operating diagram...3 Functions

More information

Looking Inside the Developer s Toolkit: Introduction to Processing XML with RPG and SQL Too! Charles Guarino

Looking Inside the Developer s Toolkit: Introduction to Processing XML with RPG and SQL Too! Charles Guarino Looking Inside the Developer s Toolkit: Introduction to Processing XML with RPG and SQL Too! Charles Guarino Central Park Data Systems, Inc. @charlieguarino About The Speaker With an IT career spanning

More information

Michael Aro. Intents Registry Eclipse Plugin

Michael Aro. Intents Registry Eclipse Plugin Michael Aro Intents Registry Eclipse Plugin Technology and Communication 2012 1 FOREWORD Writing a thesis is a long process, but it is ultimately rewarding when you can hold the finished product in your

More information

Oracle Fusion Middleware

Oracle Fusion Middleware Oracle Fusion Middleware Programming XML for Oracle WebLogic Server 11g Release 1 (10.3.5) E13724-03 April 2011 This document is a resource for software developers who design and develop applications that

More information

An Android Studio SQLite Database Tutorial

An Android Studio SQLite Database Tutorial An Android Studio SQLite Database Tutorial Previous Table of Contents Next An Android Studio TableLayout and TableRow Tutorial Understanding Android Content Providers in Android Studio Purchase the fully

More information

Creating a Custom ListView

Creating a Custom ListView Creating a Custom ListView References https://developer.android.com/guide/topics/ui/declaring-layout.html#adapterviews Overview The ListView in the previous tutorial creates a TextView object for each

More information

Application Development Issues. Overview: Velocity: what is it, what is it good for? Part 1: Code Generators Part 2: Web Applications With Velocity

Application Development Issues. Overview: Velocity: what is it, what is it good for? Part 1: Code Generators Part 2: Web Applications With Velocity Application Development Issues Overview: Velocity: what is it, what is it good for? Part 1: Code Generators Part 2: Web Applications With Velocity What is Velocity? Template Template Engine Document Document

More information

Apache FOP: Embedding

Apache FOP: Embedding How to Embed FOP in a Java application $Revision: 426576 $ Table of contents 1 Overview...3 2 Basic Usage Pattern... 3 2.1 Logging...5 2.2 Processing XSL-FO...6 2.3 Processing XSL-FO generated from XML+XSLT...

More information

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27 Android Coding Dr. J.P.E. Hodgson August 23, 2010 Dr. J.P.E. Hodgson () Android Coding August 23, 2010 1 / 27 Outline Starting a Project 1 Starting a Project 2 Making Buttons Dr. J.P.E. Hodgson () Android

More information