Advanced Java Session 9 New York University School of Continuing and Professional Studies.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
XML & Data Structures for the Internet Yingcai Xiao.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
31 Signs That Technology Has Taken Over Your Life: #6. When you go into a computer store, you eavesdrop on a salesperson talking with customers -- and.
Java API for XML Processing (JAXP) CSE 4/586: Distributed Systems Department of Computer Science and Engineering University at Buffalo, New York Jia Zhao.
Chapter 10 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 10 Sebesta: Programming the World Wide Web.
Technical Track Session XML Techie Tools Tim Bornholt.
Chapter 13 XML Concept of XML Simple Example of XML XML vs. HTML in Syntax XML Structure DTD and CDATA Sections Concept of SAX Processing Download and.
CS 174: Web Programming April 16 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools Leonidas Fegaras.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
1 XML at a neighborhood university near you Innovation 2005 September 16, 2005 Kwok-Bun Yue University of Houston-Clear Lake.
XML for E-commerce III Helena Ahonen-Myka. In this part... n Transforming XML n Traversing XML n Web publishing frameworks.
XML and its applications: 4. Processing XML using PHP.
ASP.NET and XML Presented By: Shravan S. Mylavarapu 1.
School of Computing and Management Sciences © Sheffield Hallam University To understand the Oracle XML notes you need to have an understanding of all these.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
Extensible Markup and Beyond
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
Introduction to XML Extensible Markup Language. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information.
FIGIS’ML Hands-on training - © FAO/FIGIS An introduction to XML Objectives : –what is XML? –XML and HTML –XML documents structure well-formedness.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
XML Parsers Overview  Types of parsers  Using XML parsers  SAX  DOM  DOM versus SAX  Products  Conclusion.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
Sheet 1XML Technology in E-Commerce 2001Lecture 3 XML Technology in E-Commerce Lecture 3 DOM and SAX.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
School of Computing and Information Systems CS 371 Web Application Programming XML and JSON Encoding Data.
ISO/TC 211 WG4 WI 18 Encoding Foil no. 1 Annex C XML and XMI David Skogan SINTEF Telecom and Informatics
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
XML. What is XML? XML stands for EXtensible Markup Language.XML is a markup language much like HTML. XML was designed to describe data. XML was created.
XML and SAX (A quick overview) ● What is XML? ● What are SAX and DOM? ● Using SAX.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
Structured-Document Processing Languages Spring 2004 Course Review Repetitio mater studiorum est!
Martin Kruliš by Martin Kruliš (v1.1)1.
XML SNU OOPSLA Lab. October Contents  Semistructured Data  Introduction  History  XML Application  DTD & XML Schema  DOM & SAX  Summary.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
7-Mar-16 Simple API XML.  SAX and DOM are standards for XML parsers-- program APIs to read and interpret XML files  DOM is a W3C standard  SAX is an.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML 1.Introduction to XML 2.Document Type Definition (DTD) 3.XML Parser 4.Example: CGI Gateway to XML Middleware.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML Parsers Overview Types of parsers Using XML parsers SAX DOM
Unit 4 Representing Web Data: XML
Java XML IS
XML in Web Technologies
Database Processing with XML
CHAPTER 9 JAVA AND XML.
Chapter 7 Representing Web Data: XML
Chapter X IXXXXXXXXXXXXXXXX.
Web Programming Maymester 2004
XML Parsers Overview Types of parsers Using XML parsers SAX DOM
XML Data Introduction, Well-formed XML.
More Sample XML By Sadia Anjum.
XML and its applications: 4. Processing XML using PHP
Unit 6 - XML Transformations
Presentation transcript:

Advanced Java Session 9 New York University School of Continuing and Professional Studies

2 Objectives Java and XML –Introduction to XML –Parsing XML –Web publishing frameworks using XML/XSLT

3 Java and XML Java – Portable Code XML – Portable Data XML for Presentation XML for Communication/Integration db DB Server server1 server 2 XML data

4 What is XML Meta language – that is used to define other languages Markup language that specifies neither the tag set, nor the grammar

5 XML The Wood Shop $ excellent

6 XML blue 3 average

7 Related Acronyms PI – Processing Instruction –Provide information to the application – parsers just pass them on to the application –<?xml: --- is for the parser DTD – Document Type Definition –Establishes a set of constraints –Defines valid elements – and valid attributes Namespaces – scope –Provides a way to distinguish tags by the same name

8 Related Acronyms XSL and XSLT – Extensible Stylesheet Language, Transformation –Provides a mechanism to convert an XML document to other formats such as HTML, PDF, WML etc. XPath – XML Path Language –A specification to locate a specific item within an XML document – used heavily in XSL

9 Related Acronyms XML Schema –Upcoming replacement for DTD XQL –Query language with functionality of SQL XSP –Similar to Java Server pages except that the xsps are “xml” documents with embedded java code.

10 Constraining XML Document Type Definition – DTD Specify elements Specify element hierarchy (nesting) Specify textual data - #PCDATA Keyword ANY says anything Keyword EMPTY says “empty” Entity references with <!ENTITY &amp ? -- oncr or not at all to n times * -- 0 to n times

11 Attributes <!ATTLIST [Enclosing Element] [Attr name] [type] [modifiers] Attribute Types – CDATA “name=“ in HTML enumeration “align=“ in HTML #IMPLIED #REQUIRED #FIXED

12 Parsing XML Two models for parsing XML –DOM – Document Object Model – creates a tree view of the XML document. Entire document is loaded. –SAX – Simple API for XML – much more popular.

13 Document Object Model A set of interfaces and classes –Building the document tree DOMParser parser = new DOMParser(); parser.parse(uri); Document doc = parser.getDocument(); –Traverse the tree recursively based on node type – DOCUMENT_NODE ELEMENT_NODE TEXT_NODE, CDATA_SECTION_NODE PROCESSING_INSTRUCTION_NODE ENTITY_REFERENCE_NODE DOCUMENT_TYPE_NODE

14 SAX Event based API for parsing XML documents Set of interfaces and classes – –ContentHandler –ErrorHandler

15 SAX ContentHandler startDocument() endDocument() processingInstruction() startPrefixMapping() endPrefixMapping() startElement() endElement() characters() ignorableWhitespace()

16 SAX ErrorHandler warning() error() fatalError()

17 SAX Parsing Example XMLReader parser = (XMLReader) Class.forName(parserName).newInstance(); parser.setContentHandler(counter); parser.setErrorHandler(counter); parser.parse(uri);

18 XSL template XSL is XML Locate a particular element or set of elements within the input XML document and apply a rule or set of rules <!---- rules for formatting the book -- 

19 XSL control structures

20 XSL elements 5 hello

21 XSL Transformation XML document XSL stylesheet Transformation XML document

22 XSL Transformer TransformerFactory Transformer StreamSource StreamResult

23 Simple Transformation TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer ( new StreamSource("birds.xsl")); transformer.transform( new StreamSource("birds.xml"), new StreamResult( new FileOutputStream("birds.out")));

24 Thank you