Академический Документы
Профессиональный Документы
Культура Документы
Technologies
Enterprise Application
Development
Unit Code 425
Page 3
XML
XML tags are not predefined unlike in
HTML. You must define your own tags.
XML is designed to be self-descriptive.
XML is Just Plain Text.
XML does not DO anything unlike a
programming language that have
instructions.
XML is a W3C Recommendation.
http://www.w3.org/standards/xml/
Reference:
Page 4
XML File - 1
Page 5
XML File - 2
Page 6
Importance of XML
XML is a W3C recommendation.
XML is now as important for the Web
as HTML was to the foundation of the
Web.
XML is the most common tool for data
transmissions between all sorts of
applications.
XML is becoming more and more
popular in the area of storing and
Page 7
Page 8
Page 9
Page 10
Page 11
Page 12
XML Documents
XML documents form a tree structure
that starts at "the root" and branches
to "the leaves".
Page 14
Page 17
XML Elements
An XML element is everything from
(including) the element's start tag to
(including) the element's end tag.
An element can contain other
elements, simple text or a mixture of
both.
Elements can also have attributes.
Page 18
XML Elements
In the example,
<bookstore> and
<book> have
element contents,
because they contain
other elements.
<author> has text
content because it
Also
onlytext.
<book> has an attribute
contains
(category="CHILDREN").
Page 19
XML is Extensible
XML Attributes
XML elements can have attributes in the
start tag, just like HTML.
Attributes provide additional information
about elements.
Better be used to store data about data
(metadata).
XML attributes must be quoted using either
single or double quotes.
There are no rules about when to use
attributes and when to use elements.
Page 22
XML Validation
XML with correct syntax is "Well
Formed" XML.
A "Valid" XML document is a "Well
Formed" XML document, which also
conforms to the rules of a Document
Type Definition (DTD).
Page 23
DTD
The purpose of a DTD is to define
the structure of an XML document.
Page 24
XML Schema
W3C supports an XML based
alternative to DTD called XML
Schema.
Page 25
Displaying formatted
It is possible to use CSS to format an
XML
XML document.
Page 26
XSLT
Page 27
XML Parser
Most browsers have a built-in XML
parser to read and manipulate XML.
Parser converts XML into a
JavaScript accessible object (XML
DOM object).
Page 28
XML Namespaces
XML Namespaces provide a method to
avoid element name conflicts.
Name conflicts in XML can easily be
avoided using a name prefix.
Page 30
XML Namespaces
When using prefixes in XML, a socalled namespace for the prefix must
be defined.
The namespace is defined by the
xmlns attribute in the start tag of an
element.
Namespace describes the prefix.
The namespace declaration has the
following syntax. xmlns:prefix="URI.
Page 31
XML Namespaces
When a namespace is defined for an
element, all child elements with the
same prefix are associated with the
same namespace.
The namespace URI is not used by the
parser to look up information.
Page 32
XML Namespaces
Page 33
Page 34
Default Namespaces
Defining a default
namespace for an element
saves us from using prefixes
in all the child elements.
Page 35
XML CDATA
All text in an XML document will be
parsed by the parser.
The parser does this because
XML elements can contain other
elements.
CDATA is used about text data
that should not be parsed by
the XML parser.
Page 36
XML Encoding
XML documents can contain non ASCII
characters, like Norwegian , or
French .
XML Encoding may be given as
follows.
<?xml version="1.0"
encoding="UTF-16"?>
Always use the encoding attribute
Use an editor that supports encoding
Page 37
XML Encoding
Make sure you know what
encoding the editor uses
Use the same encoding in your
encoding attribute
Page 38
Page 40
XML Technologies
XHTML (Extensible HTML)
A stricter and cleaner XML based version of
HTML.
XML DOM (XML Document Object Model)
A standard document model for accessing and
manipulating XML.
XSL (Extensible Style Sheet Language) XSL
consists of three parts:
1.XSLT (XSL Transform) - transforms XML into
other formats, like HTML
2.XSL-FO (XSL Formatting Objects)- for
formatting XML to screen, paper, etc
3.XPath - a language for navigating XML
Page 41
XML Technologies
XQuery (XML Query Language)
An XML based language for querying XML data.
DTD (Document Type Definition)
A standard for defining the legal elements in an XML
document.
XSD (XML Schema)
An XML-based alternative to DTD.
XLink (XML Linking Language)
A language for creating hyperlinks in XML
documents.
XPointer (XML Pointer Language)
Allows the XLink hyperlinks to point to more specific
parts in the XML document.
Page 42
XML Technologies
SOAP (Simple Object Access Protocol)
An XML-based protocol to let applications exchange
information over HTTP.
WSDL (Web Services Description Language)
An XML-based language for describing web services.
RDF (Resource Description Framework)
An XML-based language for describing web resources.
RSS (Really Simple Syndication)
A format for syndicating news and the content of news-like
sites.
Page 43
XML Technologies
XForms (XML Forms)
Uses XML to define form data.
WAP (Wireless Application Protocol)
A XML based language for displaying content on
wireless clients, like mobile phones.
SMIL (Synchronized Multimedia Integration Langu
age)
A language for describing audiovisual
presentations.
SVG (Scalable Vector Graphics)
Defines graphics in XML format.
Page 44
XML Editors
Professional XML editors will help you
to write error-free XML documents.
Validate your XML against a DTD or a
schema.
Force you to stick to a valid XML
structure.
A popular XML Editor is Altova
XMLSpy.
Page 45
SOAP
Reference:
http://www.w3schools.com/soap/default.asp
WSDL
Reference:
http://www.w3schools.com/wsdl/default
.asp
XSL
Reference:
http://www.w3schools.com/xsl/defaul
t.asp
Page 46