New To XML
New To XML
Document options
What is XML?
What can I do with XML? Documen Print
Platform-independent configuration and deployment instructions t options this
Does XML lend itself to application development? requiring page
Transforming XML data (XSLT) JavaScrip
Can I use XML with my favorite programming language? t are not
Are there existing XML vocabularies and applications? displayed
How is XML related to Web services and SOA?
What does the future hold for XML? E-mail
What is the best way for me to improve my XML skills? this
Summary page
<product
productNumbe Special offers
r="3263827">
<quantity>1<
/quantity>
<unitprice
currency="st
andard">3000
000</unitpri
ce>
</product>
</order>
<return></re
turn>
</transactio
n>
Learning more
XML is fairly straightforward to use, once you understand its structure. It also
provides several different methods by which you can control the structure, and
even the content, of your data. Once you begin to use XML, you'll also have
questions about the best way to design your XML structures, but it doesn't
have to be a complicated process.
Introduction to XML
Validating XML
The Java XML Validation API
XML Data Management: Information modeling with XML
The flexibility of XML means that it's useful for so many applications, such as
configuration files, Web services, data storage, and so on.
Back to top
Storing data
The most obvious use of XML is to store data. XML provides advantages for
both data-centric information (such as the data you find in a database) and
document-centric information (such as data you store in XML so you can
display it differently in different environments.)
If you're interested in storing XML data, you should know that IBM provides a
no-charge version of the new DB2 9, IBM DB2 Express-C 9. You should also
check out the new DB2 Developer Workbench, which makes it easier to use
XQuery and SQL/XML with DB2 9.
This first tutorial in a three part series shows you how to use XML to
generically store document-centric data, manipulating its presentation later:
Use Cascading Stylesheets to display XML, Part 1 introduces the use
of CSS to style XML in browsers.
IBM Notes/Domino 6 provides a great deal of opportunity for
publishing XML data. Check out Publishing XML Data using
Notes/Domino 6 for more information.
Web services
To learn how XML is used in the field of Web services, explore these
resources:
See the section below on XML and Web services for more information.
One of the most common uses of XML today is in the realm of syndication.
Millions of bloggers use RSS feeds to keep up with the latest information on
their favorite blogs, and commercial interests have begun taking an interest in
podcasting, or distributing audio and video over the internet to devices such as
iPods, which also uses XML.
Back to top
Back to top
Understanding DOM
Discover key features of DOM Level 3 Core, Part 1
Discover key features of DOM Level 3 Core, Part 2
DOM is useful when you are trying to manipulate data, because everything
resides in memory. On the other hand, it can be quite a resource hog, because
everything resides in memory.
The Simple API for XML, or SAX, solves the problem of having everything in
memory at one time by analyzing data from the beginning of the document to
the end, and notifying your application of every event, such as "start element"
or "characters". It's more resource friendly than DOM, but you can't
manipulate the data in quite the same way.
Start to understand SAX with these resources:
Understanding SAX
Tip: Set up a SAX parser
DOM and SAX are the most common ways of programmatically interacting
with XML, but sometimes you don't need to build an application to manipulate
XML data.
Back to top
Hands-on XSL
Improve your XSLT coding 5 ways
Working XML: Using XSLT for content management
Back to top
Java
XML parsing and other capabilities are built directly into Java.
PHP
PHP support for XML started out a bit rough; early implementations weren't
quite in synch with the DOM specification. These days, however, the situation
is much better, with more standard-like support.
Perl
Perl was designed to work with text, so sometimes the temptation is to work
on the text directly rather than use XML methods, but the benefits are
definitely there.
Python
C++
Ruby
The REXML library provides XML support for the Ruby programming
language.
JavaScript
JavaScript support for XML is very similar to that of Java, at least in the more
basic operations.
Back to top
Bloggers often provide external feeds that show their most recent posts and
provide links back to the original material. These feeds have turned into big
business, with advertisers taking note, and the distribution of audio and/or
video, or podcasting, becoming the focus of major media companies such as
the broadcast television networks. These feeds are in the form of XML, either
in one of the varieties of RSS, or Atom.
SVG tries to do for graphics what HTML did for desktop publishing, provide a
way to specify graphics using small, simple text instructions. SVG enables you
to create complex graphics that are both small in terms of bandwidth, and
controllable programmatically.
XForms
Back to top
An example
For example, you can make a request to the Google Web service by sending
this SOAP document as a Web request (see Listing 2).
<?xml
version='1.0
'
encoding='UT
F-8'?>
<SOAP-
ENV:Envelope
xmlns:SOAP-
ENV=
"http://sche
mas.xmlsoap.
org/soap/env
elope/"
xmlns:xsi="h
ttp://www.w3
.org/1999/XM
LSchema-
instance"
xmlns:xsd="h
ttp://www.w3
.org/1999/XM
LSchema">
<SOAP-
ENV:Body>
<ns1:doGoogl
eSearch
xmlns:ns1="u
rn:GoogleSea
rch"
SOAP-
ENV:encoding
Style=
"http://sche
mas.xmlsoap.
org/soap/enc
oding/">
<key
xsi:type="xs
d:string">00
000000000000
000000000000
000000</key>
<q
xsi:type="xs
d:string">de
ath star
trash
compactor</q
>
<start
xsi:type="xs
d:int">0</st
art>
<maxResults
xsi:type="xs
d:int">10</m
axResults>
<filter
xsi:type="xs
d:boolean">t
rue</filter>
<restrict
xsi:type="xs
d:string"></
restrict>
<safeSearch
xsi:type="xs
d:boolean">f
alse</safeSe
arch>
<lr
xsi:type="xs
d:string"></
lr>
<ie
xsi:type="xs
d:string">la
tin1</ie>
<oe
xsi:type="xs
d:string">la
tin1</oe>
</ns1:doGoog
leSearch>
</SOAP-
ENV:Body>
</SOAP-
ENV:Envelope
>
Here you see the SOAP envelope, a standard format the Web service engine
can understand. The contents of this message, in this case the
doGoogleSearch element, is known as the payload, and consists of the
information to be processed by the Web service.
In fact, most of the standards surrounding Web services -- and there are many
-- are essentially XML vocabularies. Web Service Description Language is an
XML file that describes a service, for example.
Get started with XML and Web services with these resources:
The ETTK for Web Services, an alphaworks technology, makes it easy to set
up a Web services environment, complete with server.
You can get more information on XML and Web services on the New to SOA
and Web services page.
Back to top
In the following sections are resources to help you glimpse the future of XML:
The semantic Web doesn't require XML, but you'd be hard-pressed to see that
from the way the technology currently looks. Most information is encoded in
some form of XML, whether it is the Resource Description Framework (RDF),
or independent microformats. This is because of XML's nearly universal
readability and understandability.
The world becomes smaller, and computer systems get bigger. Specifically,
researchers, companies, and other organizations begin to see the advantage in
mending their systems together into a single larger system, either to provide
enhanced computing power or to save money by eliminating waste. Because of
its platform independence, XML is perfect for exchanging information
between disparate systems.
As the Web becomes more functional, in turn users expect more from the
applications they deal with everyday. Asynchronous JavaScript with XML
(AJAX) provides a more seamless experience for the user by requesting
information -- in XML, more often than not -- in the background and replacing
only part of the page, rather than forcing the user to request a whole new Web
page. As a result, the Web has advanced in leaps and bounds in this area in just
the last year or so.
Mashups
Back to top
You can also pursue XML Certification through IBM and prepare for it by
reading XML and Related Technologies certification prep, Part 1: Architecture
and the other tutorials in this certification series.
Back to top
Summary
XML provides you with a great deal of functionality and power, but
fortunately it is itself a fairly simple and straightforward technology. Once you
learn the basics -- and that doesn't take long -- you can pick and choose what
you want to learn. If you are a programmer, you can concentrate on
programming and the various APIs. If you're not, you can concentrate on the
various uses that do not involve programming. Either way, you are sure to find
a place for XML in your work in today's world.
Back to top