1 Homework 2 l Given the DTD (figure.dtd):. 2 1. Write two XML Documents conforming to the previous DTD. All elements and attributes declared in the DTD.

Slides:



Advertisements
Similar presentations
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
Advertisements

Document Type Definitions and Schemata We have seen several ways of using XML to markup a poem, but we could invent a host of other possible approaches.
Java Applets A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
1 Introduction to Applets Overview l What is an Applet? l Steps for creating an applet l What is HTML? l Basic HTML tags l Drawing Simple Graphical shapes.
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
4/16/2007Declare a DTD File II1 Declare A DTD File - II.
Summary. Chapter 9 – Triggers Integrity constraints Enforcing IC with different techniques –Keys –Foreign keys –Attribute-based constraints –Schema-based.
Declare A DTD File. Declare A DTD Inline File For example, use DTD to restrict the value of an XML document to contain only character data.
Unit 4 – XML Schema XML - Level I Basic.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Programming Games Computer science big ideas. Computer Science jargon. Show virtual dog Homework: [Catch up: dice game, credit card or other form.] Plan.
Session III Chapter 7 – Entities and Notation in DTD’s
Implementation of ISO Encoding Joint Nordic Implementation project Morten Borrebæk Norwegian Mapping Authority,
XML Schema Vinod Kumar Kayartaya. What is XML Schema?  XML Schema is an XML based alternative to DTD  An XML schema describes the structure of an XML.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
SAX Parsing Presented by Clifford Lemoine CSC 436 Compiler Design.
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
XML (2) DTD Sungchul Hong.
Example Write the DTD rules for the following XML fragment. Kim 34 South Street NY USA Vice President $175,000 1.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
Lecture 6 XML DTD Content of.xml fileContent of.dtd file.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
Intro to Applets August 19, 2008 Mrs. C. Furman. Java Applets vs. Java Applications Java Applet: a program that is intended for use on the web. Java Applet:
20 Oct - Overview Homework #1 Group-Id rule Notes on Java text file input/output –Scanner class –Printf (like C)
JavaScript - A Web Script Language Fred Durao
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
School of Computing and Information Systems CS 371 Web Application Programming XML and JSON Encoding Data.
XML Grammar and Parser for WSOL Kruti Patel, Vladimir Tosic, Bernard Pagurek Network Management & Artificial Intelligence Lab Department of Systems & Computer.
Java.  In java you can paint your own custom drawing (such as graphs, charts, drawings and, in particular, computer games) because you cannot find standard.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
XML A Language Presentation. Outline 1. Introduction 2. XML 2.1 Background 2.2 Structure 2.3 Advantages 3. Related Technologies 3.1 DTD 3.2 Schemas and.
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
Structured Documents - XML and FrameMaker 7 Asit Pant.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
Introduction to XML XML – Extensible Markup Language.
XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.
XML Document Type Definitions and the Document object model.
CO1552 – Web Application Development Further JavaScript: Part 1: The Document Object Model Part 2: Functions and Events.
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
Accessing XML Documents Using DOM ©NIITeXtensible Markup Language/Lesson 8/Slide 1 of 23 Objectives In this lesson, you will learn to: * Use XML DOM objects.
Document Type Definition (DTD) Eugenia Fernandez IUPUI.
CSI 3125, Preliminaries, page 1 Applet. CSI 3125, Preliminaries, page 2 Applet An applet is a Java program that runs in a Web browser. An applet can be.
Advance Database S Week-6 Dr.Kwanchai Eurviriyanukul
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Introduction to JavaScript. Introduction What is it? How does it work? What is Java? Learning JavaScript JavaScript Statements JavaScript and HTML forms.
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.
Please open JCreator and follow these steps: 1)Configure  Options 2)JDK Tools 3)Choose Run Applet from drop-down 4)Click Default, then Edit 5)Click the.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
1 Validation SAX-DOM. Objectives 2  Schema Validation Framework  XML Validation After Transformation  Workshops.
SHAPES There are many shapes in our world. These are circles. Circles are never ending lines.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
Week-9 (Lecture-1) XML DTD (Data Type Document): An XML document with correct syntax is called "Well Formed". An XML document validated against a DTD is.
CITA 330 Section 2 DTD. Defining XML Dialects “Well-formedness” is the minimal requirement for an XML document; all XML parsers can check it Any useful.
XML Schemas Dr. Awad Khalil Computer Science Department AUC.
XML Parsers Overview Types of parsers Using XML parsers SAX DOM
Unit 4 Representing Web Data: XML
RSA Model Builder B-Spec Review
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Database Processing with XML
The XML Language.
Exact XML Master Exam I Dumps - I Real Exam Questions Answers
Chapter 7 Representing Web Data: XML
XML Parsers Overview Types of parsers Using XML parsers SAX DOM
More Sample XML By Sadia Anjum.
Extend Text Editor to Draw shapes
XML Parsers.
Assign #3: Enhance you Tank Game Assign #3: Graphical Menu System
Presentation transcript:

1 Homework 2 l Given the DTD (figure.dtd):

2 1. Write two XML Documents conforming to the previous DTD. All elements and attributes declared in the DTD must appear at least once in each document. 2. Use DOM API to write a Java program that load an XML Document that are valid w.r.t the previous DTD as its external subset. Your program should then use java2d to draw all corresponding shapes and texts according to data given in the input XML document.

3 Example figure0.xml The first rectangle The first oval

4 Notes l For those students unfamiliar with java2d graphics, we provide an executable java2d sample program: HW23Sample.java. You can compile and execute it to see how it work. l To help grading, please name your main java classes as HW2 and HW3, respectively. Both should have a main(String[]) method accepting as input an input file name. So we can invoke them as follows: >java HW2 figure1.xml >java HW3 figure1.xml l You can subclass HW23Sample in your HW2/3 to reuse what have been supplied in it.