XML and DTD Please you speaker notes for additional information!

Slides:



Advertisements
Similar presentations
How to Create a Local Collection
Advertisements

1 The MITRE Using XSL to Generate XHTML Documents Roger L. Costello XML Technologies.
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
PL/SQL User Defined Types Record and Table Please use speaker notes for additional information!
Reports Using SQL Script Please check speaker notes for additional information!
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
Order Entry System Please use speaker notes for additional information!
XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
HTML and Forms Please use the speaker notes to receive the comments accompanying the slides!
Group functions using SQL Additional information in speaker notes!
Relational example using donor, donation and drive tables For additional information see the speaker notes!
More on IF statements Use speaker notes for additional information!
Document Type Definition DTDs CS-328. What is a DTD Defines the structure of an XML document Only the elements defined in a DTD can be used in an XML.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
Review Writing XML  Style  Common errors 1XML Technologies David Raponi.
IS 373—Web Standards Todd Will
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introduction to XML This material is based heavily on the tutorial by the same name at
SQL Use of Functions Character functions Please use speaker notes for additional information!
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
Cursors in PL/SQL Includes cursor example and continuation of first cursor example Please use speaker notes for additional information!
Validating DOCUMENTS with DTDs
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML Structures For Existing Databases Ref: 106.ibm.com/developerworks/xml/library/x-struct/
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.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Example Write the DTD rules for the following XML fragment. Kim 34 South Street NY USA Vice President $175,000 1.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
More on relational databases, including 1 to 1, 1 to many and many to many relationships Please use speaker notes for additional information!
XML, DTD, ENTITY Please see speaker notes for additional information!
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
Relationships and Advanced Query Concepts Using Multiple Tables Please use speaker notes for additional information!
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
XP 1 New Perspectives on XML Binding XML Data with Internet Explorer.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
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.
SQL and Conditions Speaker notes will provide additional information!
Manipulating data within PL/SQL Please use speaker notes for additional information!
An Introduction to XML Sandeep Bhattaram
Order Entry Program Please see speaker notes for additional information!
Functions Please use speaker notes for additional information!
Exceptions in PL/SQL Please use speaker notes for additional information!
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Introduction to Oracle - SQL Additional information is available in speaker notes!
ASP.NET Binding and an Introduction to Database Queries Please use speaker notes for additional information!
Label Assignment Please use speaker notes for additional information!
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
Document Type Definition (DTD) Eugenia Fernandez IUPUI.
Analysis of SAMPLE1.CBL Please check speaker notes for additional information!
PHP with MYSQL Please use speaker notes for additional information!
Sequential Update Assignment Notes Please use speaker notes for additional information!
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Extensible Markup Language (XML) Pat Morin COMP 2405.
Introduction to Procedures
MySQL - Creating donorof database offline
Please see speaker notes for additional information!
Session III Chapter 6 – Creating DTDs
New Perspectives on XML
DTD (Document Type Definition)
Session II Chapter 6 – Creating DTDs
Allyson Falkner Spokane County ISD
Document Type Definition (DTD)
Presentation transcript:

XML and DTD Please you speaker notes for additional information!

<!DOCTYPE customer [ ]> Susan Ash 12 Elm St Braintree MA This holds just one customer - customer is the root. The elements are the declarations. I used the xml document shown here in a html program on the next slide to produce the output that you see. Note that the data you see comes from the xml, the rest of the information comes from the html.

Customers Fall River Store 112 Main Street Fall River, MA Customer Id: Name: Address: City: State: Zip: This prints the header information at the top of the screen. This establishes Customer_Id as customer.xml. This code establishes which data field is to be shown from the xml. This shows the identifying literals.

<!DOCTYPE customers [ ]> Susan Ash 12 Elm St Braintree MA Stephen Daniels 45 East St Brooklyn NY I now want to add a second customer to my data. To do this I make the root the name of the customer group or collection (customers) and each individual customer becomes a record (customer).

Customers Fall River Store 112 Main Street Fall River, MA Customer Id: Name: Address: City: State: Zip:

First <button onClick="Customer_Data.recordset.movePrevious(); if (Customer_Data.recordset.BOF) Customer_Data.recordset.moveFirst()"> Previous <button onClick="Customer_Data.recordset.moveNext(); if (Customer_Data.recordset.EOF) Customer_Data.recordset.moveLast()"> Next Last

<!DOCTYPE customers [ ]> Susan Ash 12 Elm St Braintree MA Stephen Daniels 45 East St Brooklyn NY When using the DTD you specify: <!DOCTYPE root [ declarations ]> The first element says that customers (the root element), can contain one or more occurrences of customer. The customer element contains 6 child elements that are listed. Each child element is listed individually and is given the #PCDATA which indicates character/string data.

<!DOCTYPE customers [ ]> Susan Ash 12 Elm St Braintree MA Stephen Daniels 45 East St Brooklyn NY In this example, custid is not a child element, it is an attribute of customer. ID means calls for uniqueness and #REQUIRED means an entry is required. Quote from w3schools: “Should you avoid using attributes? Here are some of the problems using attributes: * attributes cannot contain multiple values (child elements can) * attributes are not easily expandable (for future changes) * attributes cannot describe structures (child elements can) * attributes are more difficult to manipulate by program code * attribute values are not easy to test against a DTD If you use attributes as containers for data, you end up with documents that are difficult to read and maintain. Try to use elements to describe data. Use attributes only to provide information that is not relevant to the data. To validate, I used:

<!DOCTYPE donors [ <!ELEMENT donor(name, address, yrfirst?, contact?) <!ELEMENT name (#PCDATA) ]> John Doe <![CDATA[ 123 Elm St Braintree, MA ]]> 1995 Ann Smith

<!DOCTYPE donors [ <!ELEMENT donor(name, address, yrfirst?, contact?) <!ELEMENT name (#PCDATA) ]> John Doe <![CDATA[ 123 Elm St Braintree, MA ]]> 1995 Ann Smith Need the > at the end.

<!DOCTYPE donors [ ]> John Doe <![CDATA[ 123 Elm St Braintree, MA ]]> 1995 Ann Smith

<!DOCTYPE donors [ ]> John Doe <![CDATA[ 123 Elm St Braintree, MA ]]> 1995 Ann Smith Mary Wilson The idno is an attribute of donor. The ID means it must be unique. The title is an attribute of name and it can have any one of the titles included in the list. #IMPLIED means that this is an optional attribute. CDATA allows for a large block of text that the XML processors interprets only as text.

<![CDATA[ 14 Main St Fall River, MA ]]> 1996 David Costa Nancy Taylor <![CDATA[ 1 Heritage Rd New Bedford, MA ]]> 1994 Ann Smith Robert Brooks <![CDATA[ 45 East St Weymouth, MA ]]> 1996 Roger Brown

DONOR DONATION The XML has been set up to have a series of donors and information about the donor and for each donor, one or more donations and information about the donation.

<!DOCTYPE donors [ ]> John Doe <![CDATA[ 123 Elm St Braintree, MA ]]> 1995 Ann Smith Donations has been added to the list of elements in donor. Within donation there is room for multiple donations. Each with have a required unique number called donationid, a reference to the donor called given by and the elements date of contribution and amount of contribution.

7/5/ /14/ Mary Wilson <![CDATA[ 14 Main St Fall River, MA ]]> 1996 David Costa 5/15/ Nancy Taylor This shows the data for the first donor which includes donation 1 and donation2. For each donation, there are the identifying attributes and the date and amount of the contribution.

<![CDATA[ 1 Heritage Rd New Bedford, MA ]]> 1994 Ann Smith 1/5/ /20/ /12/ /5/ Robert Brooks

<![CDATA[ 45 East St Weymouth, MA ]]> 1996 Roger Brown 1/1/ /1/ /1/