Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Overview
Essentials of XML
Topics
Page 1
What is XML?
What Is XML?
The Extensible Markup Language (XML) is a markup language for
putting structured data into a text file. Defined by the W3C, the XML
specification provides a syntactically strict set of standards for
document structure while allowing developers, organizations, and
communities to define their own vocabularies. XML files are not
meant to be read, but being text files they can be debugged by an
expert, using a simple text editor.
XML is considered a markup language because it uses tags to
delimit pieces of data, leaving the interpretation of that data to the
application processing it. XML is a subset of a richer, and more
complex meta-language known as SGML (Standard Generalized
Markup Language). XML was developed to overcome the complexity
of SGML and the inflexibility of HTML (Hypertext Markup
Language).
Page 2
Pre-reading Materials
Platform Independent
Unicode-based (internationalization)
Built-in Validation (schema or DTD)
Predefined programmatic access (DOM & SAX)
Self-aware information (address is address)
The fact that XML separates data from its appearance, the same
data can be displayed in any number of ways, making it useful and
effective in a variety of contexts.
Page 3
Page 4
Pre-reading Materials
Elements are delimited by start and end tags that describe the data
found in between, e.g. <first>John</first>.
Note that the element includes both the start and end tags, as well
as the data contained within.
Page 5
Page 6
Pre-reading Materials
Page 7
DTD
or
Schema
DTD
or
Schema
XML
Parser
XML
Application
XML
instance
XML
instance
XML
instance
Page 8
Pre-reading Materials
Interpreting XML
"
Interpreting XML
Page 9
! SOX v2.0
Page 10
Pre-reading Materials
HR XML
Contact Definition
XML Transform
Contact
ContactRecord
Record
ininBilling
BillingSystem
System
Person
PersonName
Name
PositionTitle
PositionTitle
VoiceNumber
VoiceNumber
E-mail
E-mail
Fax
FaxNumber
Number
Contac
ContacRecord
Record
ininCRM
CRMSystem
System
Identifier
Identifier
Contact
ContactName
Name
Telephone
Telephone
Address
Address
Email
Email
Fax
Fax
Page 11
XML Namespaces
<pr:billingInfo
xmlns:pr = "www.company.com/NS/patientRecords"
xmlns:ir = www.company.com/NS/mortgageRecords>
<pr:billingInfo>
mr:title
pr:phoneGroup
mr:terms
mr:taxValue
mr:rate
mr:owner
mr:interestRate
pr:patientRecord
pr:title
pr:name
XML Namespaces
Schema is a collection of type definitions and element declarations
whose names belong to a particular namespace. Namespaces enable
us to differentiate between definitions and declarations from different
vocabularies. Using namespaces helps avoid naming conflicts and
promotes re-usability.
Components from different namespaces are differentiated via a
prefix. This enables an application to understand the definition and
context of elements and other components from many different
sources, even if some components share the same name. (Above:
Namespaces can be used to distinguish a title within the mortgage
industry from a title used as part of a persons name.)
These prefixes used are each associated with a URI (Uniform
Resource Identifier), which must be unique for each schema
definition.
Page 12