Download XML - FSU Computer Science Department

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Database wikipedia , lookup

Data model wikipedia , lookup

Data analysis wikipedia , lookup

Resource Description Framework wikipedia , lookup

Versant Object Database wikipedia , lookup

Information privacy law wikipedia , lookup

Data vault modeling wikipedia , lookup

Business intelligence wikipedia , lookup

Open data in the United Kingdom wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

National Information Exchange Model wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Semantic Web wikipedia , lookup

XML wikipedia , lookup

Transcript
SEA Side
Software •AAnnotation
Engineering Annotations
4:
XML
One hour presentation to inform you of new
techniques and practices in software development.
Professor Sara Stoecklin
Director of Software Engineering- Panama City
Florida State University – Computer Science
[email protected]
[email protected]
850-522-2091
850-522-2023 Ex 182
XML HYPE
XML is one of the most heralded technologies to come
across the wire in the most recent years since .com
became a household world.
XML has been given an enthusiastic response by web
development communities.
XML E-commerce and knowledge management is
greatly enhanced by XML.
XML allows a flexibility in software development that
adds to robust solutions to problems.
News about XML
XML is a project of the WORLD WIDE Web
Consortium (W3C) and the development of the
specification is being supervised by their XML
working group.
XML is a public format not proprietary
development of any company
XML has emerged as an accepted standard for
data exchange replacing the legacy Electronic
Data Interchange.
What is XML
XML is an acronym for EXtensible Markup Language
XML is a new language designed to make information
self describing.
XML is a markup language because it uses tags to
mark up data that perhaps are used in web based HTML
documents.
XML is extensible because it enables users to create
their own collection of tags to describe their data.
XML and HTML
Both consist of tags elements and attributes
HTML is used to display information and XML is
used to define information.
XML is similar to HTML in syntax and
implementation but different with regard to
functionality.
HTML allows user to control how documents are
displayed XML allows them to describe the actual
contents of the document.
XML is a complement to HTML not a replacement.
XML DEFINITON
DEFINITION:
XML is a text based meta language that
uses tags, elements and attributes to add
structure and definition to documents,
databases, files, and other input and outputs
of computer applications.
Meta Language: A language for describing other languages which
lets you design your own customized markup language for limitless
different types of documents
XML uses tags, elements and attributes.
<customers>
User Defined Tag called Customer
<customer>
<name = “Dr. Sara Stoecklin”>
<street = “4750 Collegiate Dr.” >
<city = “Panama City” >
<state =“Florida” >
<zip = “32407”>
<emailaddr = [email protected]>
</customer>
</customers>
Attributes are defined to
describe a name/value
Element Customer and element
pair. Values are enclosed
address(case sensitive name) are
in double quotes.
defined with a beginning and
ending tag.
To add structure and definition to
documents, databases, and other I/O.
GUI
<customer>
<name = “Dr. Sara Stoecklin”>
<street = “4750 Collegiate Dr.” >
<city = “Panama City” >
<state =“Florida” >
<zip = “32407”>
<emailaddr = [email protected]>
</customer>
WEB
.pdf
Dr. Sara Stoecklin
4750 Collegiat Dr.
Panama City, Florida32407
Database
e-mail
text
Dear Dr. Stoecklin,
.doc
HTML
Why use XML with HTML?
•One the WEB, it removes the constraints
•Dependence of the single inflexible HTML document type.
•Availability of tailored format.
•Allows reuse of information content
•XML separates data from Applications espec. HTML
•Your application may manipulate and display the data but
XML defines the format of the data.
•XML stores data inside HTML documents
•can be stored inside HTML pages called Data Islands
EXAMPLE - Why use XML with HTML?
•HTML is a good language for displaying data.
•Today customers of the WEB want to take orders from
customers, display medical records, run a factory
robot, and HTML is a weak language to do these
things.
•Your doctor may be able view the web and see your
drug reaction history, but he cannot easily add yet a
drug reaction that updates the hospitals database
easily. HTML is WYSWYG.
•Solution, make tags which allows the description of
data that can be used to update a database.
EXAMPLE - Why use XML with HTML?
•I am a company like Amazon.com.
•In the last week I have had several request for a book
named XML – A Strategic Solution by Dr. Sara Stoecklin.
• I would like to know who publishes the book.
•I would also like to negotiate with the book company to
determine what price I would pay by using any special
customer discounts and volume discounts.
•Now I could get on the phone and negotiate, this may take
months to come to the end of a deal and I want to offer the
book to my customers tomorrow.
EXAMPLE - XML and B2B
•I have a program that searches the databases of book
publishers and finds if this is the publisher of the book.
•I do this by reading their XML for a definition of the book.
I build the XML with my own data and send a request to
their application for the data specified in the XML record.
I do this with each publisher which each has a different
format for the data. But XML allows me to communicate
with most of the publishers.
•I find the book in Addison Wesley.
•Now I begin to negotiate for a price again with an XML
description of the price, volumes and special discounts.
Why use XML anywhere?
•XML can be extended to carry more information.
• XML can be used to exchange data
•In the real world computer systems and databases contain
data in incompatible format and time consuming challenges
for developers to exchange this data. Converting the data
to XML reduces this problem.
•XML can be used to share data
•XML can be used to store data
•Used to store data in files and databases
Why XML revisited.
•XML allows the definition of a structure that can be used in a
variety of places.
•In a database table
•In an input or output document
•In memory to share data
•In communications between applications
•In shared heterogeneous data application
•In a prototype definition
What does XML look like.
•XML programs, called documents, contains elements
and attributes but also may contain the XML
declaration.
•<?xml version = 1.0” encoding = “UTF88”?>
•XML also contains the definition of what is called the
root element. Every XML document must have a root
document.
•XML contains instructions to the needed XML parser
to allow parsing of the XML data.
How do I Parse the XML?
•XML can be parsed using a variety of programs.
•The XML is both validated for syntax and any
known semantics and then the data extracted is
returned.
•Many public parsers are available. They are
available in a variety of languages such as Java,
Lisp, SmallTalk, C, C++, Ada, Prolog, V-Basic,
etc….
More XML
•XML documents may contain a Document Type
Definition (DTD) that describes the structure of
the XML document from a metadata perspective.
•Since XML is a meta data language already, this
means the DTD is a meta meta definition of the
data.
More XML
•DTD’s define
•The elements and attributes that can appear in
a document.
•Which elements are child elements and what
number, order and placement they must have.
•The default values for elements and attributes.
Remember our customers.
<customers>
<customer>
<name = “Dr. Sara Stoecklin”>
<street = “4750 Collegiate Dr.” >
<city = “Panama City” >
<state =“Florida” >
<zip = “32407”>
<emailaddr = [email protected]>
</customer>
</customers>
A DTD for Customers.
<?xml version = “1.0” encoding = “UTF – 8”?>
<!ELEMENT customers (customer*)>
<!ELEMENT customer
(name?, address?, street?, city?, state?, zip?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip (#PCDATA)>
<!ELEMENT emailaddr (#PCDATA)>
DTD’s
•DTD’s define the legal building blocks of
an XML document. It list the legal elements
•DTD’s can be used to validate XML
documents
• DTD’s provide the applications wit an
advance notice of what names and structures
can be used in a particular document type.
DTD’s
•DTD’s can be used to describe common
documents such as a check, a newspaper
article, a bill, a TV schedule, a movie, a
book, etc.
•There are thousands of DTD already
defined and many can be downloaded and
used freely or you can write your own.
SCHEMA’s
•Another method of defining the metadata of an XML
document which is more flexible.
•Schemas handle data types of the various elements text
data by an ElementType or an AttributeType.
•Schemas handle namespaces.
•Namespaces are collection of names that are used as
element or attribute names in the XML document. The
namespace is identified by some Uniform Resource
Identifier (URI) as a URL or a URN (unified resource
locator or number)
Using XML
•Once you have an XML document, you may
•use it in an application.
•use it in a web page
•use it in a JSP or ASP
•place the XML in SOAP to exchange data.
•stylize the data using a style sheet such as
XSL or CSS.
XSL
•Once you have the data in XML then you can
stylize your data using style sheets such as XSL or
CSS.
•CSS is a cascading stylesheet specification that
provides a simple syntax for assigning styles to
elements.
•XSLT is an extensible stylesheet to allow XML
documents to be transformed into different
formats.
Other XML items
•Data Islands – XML Document that exists within
an HTML page allowing scripting.
•Object Model – collection of objects that allow
you to access and manipulate the data in an XML
document.
•DOM – Object model modeled after a dree with
nodes to represent the structure of data.
Other MLs
•SGML – standard generalized Markup Language
that extends HTML – preview to XML.
•ebXML – allows definition of business processes
(workflows) with messaging, security, and
scenario intervention.
•tpaXML – negotiating software to allow trading
partner contracts and relationships to be
established.
How it Works
GUI
Database
<customer>
<name = “Dr. Sara Stoecklin”>
<street = “4750 Collegiate Dr.” >
<city = “Panama City” >
<state =“Florida” >
<zip = “32407”>
<emailaddr = [email protected]>
</customer>
WEB
.pdf
Dr. Sara Stoecklin
4750 Collegiat Dr.
Panama City, Florida32407
Style
Sheet
e-mail
text
Dear Dr. Stoecklin,
.doc
HTML
Strategic View
•Business
•Provides solution for JIT inventory
replenishment. Enables B2B transactions through
e-procurement software with public marketplaces.
•Allows content management and integration
across an enterprise.
•Allows the portals to access applications and
databases easily.
•Allows deployment of portal servlets.
•Provides a means of standard vocabulary for
agents.
Strategic View
•Software Engineering
•Allows integration of data from disparate
systems and applications.
•Allows definition of transactions, profiles,
and protocols
•Fundamental to creation of component
based architectures.
•Allows an integration to specifications of
a system using UML.
References
•Newsgroups – comp.text.xml.
•Discussion group http://listserv.heanet.ie/xml-l.html
•Development mailing list xml-dev-request@;lists.xml.org
•List of Tools http://lambda.garshol.priv.no/download/smltools
•Other Sites
• Web Review
http://www.webreview.com
•Web Techniques Magazine
•World Wide Web Consortium
http://www.webtechniques.com
http://www.w3.org
References
•Ahmed, Kal; Danny Ayers, Mark Birbeck, Jay Cousins, David Dodds,
Joshua Lubell, Miloslav Nic, Daniel Rivers-Moore, Andrew Watt, Rob
Worden, Ann Wrightson. Professional XML Metadata. Wrox Programmer to
Programmer Series. Birmingham, UK: Wrox Press Ltd., 2001. Extent: x +
568 pages. ISBN: 1-861004-51-6.
•Bradley, Neil. The XSL Companion: Styling XML Documents. London/New
York: Addison-Wesley/Pearson Education, [May] 2000.
•Cagle, Kurt; and Jon Duckett, Oliver Griffin, Stephen Mohr, Francis
Norton, Nikola Ozu, Ian Stokes-Rees, Jeni Tennison, Kevin Williams.
Professional XML Schemas. Wrox Programmer to Programmer Series.
Birmingham, UK: Wrox Press Ltd., [July] 2001.
•Carlson, Dave. Modeling XML Applications with UML. Practical eBusiness Applications Boston/San Francisco: Addison-Wesley, 2001.
•Ray, Erik T. Learning XML: (Guide to) Creating Self-Describing Data.
O'Reilly, [February] 2001.
References
•XML.com
http://www.xml.com
•XML.org
http://www.xml.org
•XML Magazine http://xmlmag.com
•Robin Cover's SGML/XML Web Page
http://www.oasis-open.org/cover/xml.html
•Sun's XML Site http://java.sun.com/xml/
•Microsoft's XML Site
http://msdn.microsoft.com/xml/default.asp
•IBM's XML Site
http://alphaworks.ibm.com/tech
•Apache XML Project
http://xml.apache.org
•Free XML tools and software
http://www.garshol.priv.no/download/xmltools/
Good Links
http://www.csclub.uwaterloo.ca/u/relander/XML/xml_mw.html "XML: the new markup wave"
http://sunsite.unc.edu/pub/sun-info/standards/xml/why/xmlapps.htm "XML, Java, WEB
http://www.geocities.com/SiliconValley/Peaks/5957/xml.html "What the ?XML!" (links)
http://www.xmlinfo.com/ "The XML Information Site".
http://www.yourwebtools.com/toolbox/html Electronic magazine.
http://www.wdvl.com
Web Developer's Virtual Library.
http://www.oasis-open.org/ Standards Organization
http://www.ontology.org - business ontology
http://www.w3.org/XML/ World Wide Web consortium XML pages.
http://www.xml.com The XML Commune. (Electronic magazine)
http://www.eu.microsoft.com/xml Microsoft's XML pages.
http://www.arbortext.com/xmlresrc.html XML references and links tools especially
http://www.inso.com/xml/index.htm XML tool vendor.
http://www.poet.com/products/cms/xml_library/index.html NT Object Database vendor.