Visit Reuters on the Web

The What, Why, and How of XML

An Introduction to XML for Technical Users

 

Anthony B. Coates

Equity Systems Pty Ltd

A subsidiary of Reuters Plc.

 

Copyright © MM Reuters Plc.

tony.coates@reuters.com

2000/03/21

Top

Contents

  1. The What, Why, and How of XML
  2. What is XML?
  3. Why Use XML?
  4. How Do You Get Into XML?
  5. How - XML Viewers
  6. How - XML Editors
  7. How - XML Parsers
  8. How - XSL & XSLT
  9. How - XPath/XPointer/XLink
  10. How - XML in Databases
  11. How - XML and Objects
  12. How - Messaging in XML
  13. How - XML Repositories
  14. XML Tips
  15. References - XML
  16. References - XML Standards
  17. References - XML Tools
  18. References - XML Repositories
  19. References - Industry Schemas
  20. References - Articles
  21. References - Other
Top

What is XML?

Top

What is XML?

Top

What is XML?

Top

What is XML?

Top

What is XML?

<html>...</html>
Top

What is XML?

<?xml version="1.0"?>
<my-document>
  <author name="A.B.Coates"/>
  <my-title>
    Document Title
  </my-title>
  <my-section>
    <my-title>
      Section Title
    </my-title>
    This is the text
    of my section.
  </my-section>
</my-document>
Top

What is XML?

<?xml version="1.0"?>
<order supplier="Babies Online">
  <item code="XYZ-2000"
        name="No-Leak Nappies"/>
  <unit-price currency="AUD">5</unit-price>
  <volume>10000</volume>
  <valid-until>20000630</valid-until>
</order>
Top

What is XML?

<?xml version="1.0"?>
<html xmlns:fn="www.furniture.com/products">
  <body>
    <!-- Here is an XHTML table -->
    <table>
      <tr><td>1</td><td>2</td></tr>
    </table>
    <!-- Here is another kind of table -->
    <fn:table>
      <fn:material>wood</fn:material>
      <fn:legs>6</fn:legs>
    </fn:table>
  </body>
</html>
Top

What is XML?

Top

What is XML?

<p>A paragraph of text.</p>
<br></br>
<br/>
<?xml version="1.0"?>
Top

What is XML?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE account SYSTEM "sample.dtd">
<account accountNumber="AC11223344">
  <customer>
    <name firstName="John" lastName="Citizen"/>
  </customer>
  <balance>1234.56</balance>
</account>
Top

What is XML?

<!-- A name contains neither tags nor text,
     but has two attributes.
     The "lastName" is required,
     while the "firstName" is optional.
  -->
<!ELEMENT name EMPTY>
<!ATTLIST name
  firstName CDATA #IMPLIED
  lastName CDATA #REQUIRED
>

<!-- A customer has a name. -->
<!ELEMENT customer (name)>
Top

What is XML?

<!-- The balance is in text format. -->
<!ELEMENT balance (#PCDATA)>

<!-- Each account belongs to one or
     more customers, and has a balance.
  -->
<!ELEMENT account (customer+,balance)>
<!ATTLIST account
  accountNumber ID #REQUIRED
>
Top

What is XML?

<?xml version="1.0" encoding="UTF-8"?>
<account xmlns="sample.xsd"
         accountNumber="AC11223344">
  <customer>
    <name firstName="John" lastName="Citizen"/>
  </customer>
  <balance>1234.56</balance>
</account>
Top

What is XML?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema PUBLIC
  "-//W3C/DTD XML Schema Version 1.0//EN" 
  "http://www.w3.org/XML/Group/
   1999/09/23-xmlschema/structures/
   structures.dtd"
>
<schema>
Top

What is XML?

  <!-- A name contains neither tags nor text,
       but has two attributes.
       The "lastName" is required,
       while the "firstName" is optional.
    -->
  <element name="name">
    <archetype content="empty">
      <attribute name="firstName"
                 type="string"/>
      <attribute name="lastName"
                 type="string"/>
    </archetype>
  </element>
Top

What is XML?

  <!-- A customer has a name. -->
  <element name="customer">
    <archetype content="elemOnly">
      <element ref="name" minOccurs='1'
                          maxOccurs='1'/>
    </archetype>
  </element>

  <!-- The balance is a decimal number. -->
  <element name="balance" type="decimal"/>
Top

What is XML?

  <!-- Each account belongs to one or
       more customers, and has a balance.
    -->
  <element name="account">
    <archetype content="elemOnly">
      <element ref="customer" minOccurs='1'
                              maxOccurs='*'/>
      <element ref="balance" minOccurs='1'
                             maxOccurs='1'/>
      <attribute name="xmlns"
                 type="string"/>
      <attribute name="accountNumber"
                 type="string"/>
    </archetype>
  </element>

</schema>
Top

Why Use XML?

Top

Why Use XML?

Top

Why Use XML?

Top

Why Use XML?

Top

Why Use XML?

Top

Why Use XML?

Top

Why Use XML?

Top

How Do You Get Into XML?

Top

How - XML Viewers

Top

How - XML Viewers

Top

How - XML Viewers

Top

How - XML Viewers

<?xml-stylesheet href="style.css"
                 type="text/css"?>
Top

How - XML Editors

Top

How - XML Editors

Top

How - XML Editors

Top

How - XML Parsers

Top

How - XML Parsers

Top

How - XML Parsers

Top

How - XML Parsers

Top

How - XML Parsers

Top

How - XSL & XSLT

<?xml-stylesheet href="transform.xsl"
                 type="text/xml"?>
Top

How - XSL & XSLT

Top

How - XSL & XSLT

Top

How - XSL & XSLT

Top

How - XPath/XPointer/XLink

Top

How - XPath/XPointer/XLink

doc.xml#chapter[3]/section[2]/paragraph[4]
Top

How - XPath/XPointer/XLink

Top

How - XPath/XPointer/XLink

Top

How - XPath/XPointer/XLink

Top

How - XML in Databases

Top

How - XML in Databases

Top

How - XML in Databases

Top

How - XML and Objects

Top

How - Messaging in XML

Top

How - XML Repositories

Top

How - XML Repositories

Top

How - XML Repositories

Top

XML Tips

Top

XML Tips

Top

XML Tips

Top

XML Tips

Top

References - XML

XML.com
http://www.XML.com/
A good place to start learning about XML. The Annotated XML Spec is noteworthy, but not compulsary reading.
xmlhack.com
http://www.xmlhack.com/
News and articles for XML developers.
The XML Cover Pages
http://www.oasis-open.org/cover/sgml-xml.html
Robin Cover's encyclopædic reference for XML standards, articles, and tools.
Top

References - XML Standards

XML @ W3C
http://www.w3.org/XML/
The W3C's XML site. This is where the standards are. Some of them can be heavy reading.
XML Namespaces
http://www.w3.org/TR/REC-xml-names
XML Schemas #0: Primer
http://www.w3.org/TR/xmlschema-0/
XML Schemas #1: Structures
http://www.w3.org/TR/xmlschema-1/
XML Schemas #2: Datatypes
http://www.w3.org/TR/xmlschema-2/
XHTML
http://www.w3.org/TR/xhtml1
XHTML is the modular XML replacement for HTML 4.
Top

References - XML Standards

SAX
http://www.megginson.com/SAX/index.html
Simple API for XML. Converts XML into a stream of events.
DOM @ W3C
http://www.w3.org/DOM/
Document Object Model. Converts XML into a tree of nodes.
XSL @ W3C
http://www.w3.org/Style/XSL
Extensible Stylesheet Language.
XSLT Specification
http://www.w3.org/TR/xslt
XSL Transformations.
XSL Specification
http://www.w3.org/TR/xsl/
XSL Formatting Objects.
XPath Specification
http://www.w3.org/TR/xpath
How to specify a location in an XML document.
Top

References - XML Standards

CSS @ W3C
http://www.w3.org/Style/CSS
Cascading Style Sheets.
XPointer Specification
http://www.w3.org/TR/xptr
How to specify a location or range in an XML document.
XLink Specification
http://www.w3.org/TR/xlink/
How to do hyperlinking in XML.
XML Query Requirements
http://www.w3.org/TR/xmlquery-req
The latest progress on the XML Query specification.
Top

References - XML Tools

IE5
http://www.microsoft.com/windows/ie/default.htm
Displays XML as a tree by default, and can display XML using CSS or XSLT.
Mozilla (Communicator 6 preview)
http://www.mozilla.org/
Can display XML using CSS.
Apache XML Tools
http://xml.apache.org/
Xerces parser, Xalan XSLT, FOP XSL Formatting Objects, and Cocoon servlet for transforming server-side XML to client-side HTML or XML. Xerces and Xalan available either as Java or C++.
James Clark's XML Resources
http://www.jclark.com/xml/
XP parser (Java), expat parser (C++), XT (XSLT in Java), and XML test cases. Self-funded, James Clark produces some of the best XML & SGML software available today, and makes it available for free.
Java Technology & XML @ Sun
http://java.sun.com/xml/
JAXP (Java API for XML Parsing) is Sun's new standard API for pluggable Java XML parsers, based on SAX and DOM.
XML @ IBM developerWorks
http://www.ibm.com/developer/xml/
News, articles, and software.
IBM alphaWorks
http://www.alphaWorks.ibm.com/
IBM's alphaWorks has an amazing range of XML (and other) tools to try for free; some of them very useful.
Top

References - XML Tools

XML & XSL @ Microsoft
http://msdn.microsoft.com/xml/default.asp
Check out Microsoft's XML parser and XSLT engine here.
Oracle XML Developer's Kit
http://technet.oracle.com/tech/xml/
Oracle XML parser and XSLT engine. Java, C/C++, and PL/SQL.
Top

References - XML Tools

Tamino
http://www.softwareag.com/tamino/
XML server based on a hierarchical database. Everything going in or out is XML.
Bluestone XML Suite
http://www.bluestone.com/SaISAPI.dll/SaServletEngine.class/products/dynamic.jsp?pid=60
Well-known XML server.
eXcelon B2B Solutions
http://www.objectdesign.com/products/index.html
Well-known XML server.
DataChannel Server
http://www.datachannel.com/
DataChannel's Chief Scientist, Norbet Mikula, wrote one of the first XML parsers (as his PhD project).
Web Distributed Data eXchange
http://www.wddx.org/
A system for exchanging XML documents via the Web.
Top

References - XML Tools

Arbortext Adept
http://www.arbortext.com/Products/ADEPT_Series/adept_series.html
A good, high-end XML editor.
SoftQuad XMetal
http://www.xmetal.com/
A good, high-end XML editor.
IBM Xeena
http://www.alphaworks.ibm.com/tech/xeena
A free XML editor in Java. Requires a DTD, and makes sure that your document fits the DTD.
Microsoft XML Notepad
http://msdn.microsoft.com/xml/notepad/intro.asp
A free XML editor for Windows. Allows you to write freeform XML without a DTD.
Top

References - XML Repositories

XML.org
http://www.XML.org/
BizTalk.com
http://www.BizTalk.com/
schema.net
http://www.schema.net/
Top

References - Industry Schemas

IBM XML specification for business-to-business transactions
http://www-4.ibm.com/software/developer/library/tpaml.html
UN's ebXML specification for global e-commerce
http://www.ebXML.org/
Financial Products Markup Language specification
http://www.FpML.org/
Top

References - Articles

XML for the Absolute Beginner
http://www.javaworld.com/jw-04-1999/jw-04-xml.html?032499txt
JavaWorld article.
Schema Repositories: What's at Stake?
http://www.xml.com/pub/2000/01/26/feature/index.html
An interesting discussion of the politics of schema repositories.
Inside SOAP
http://xml.com/pub/2000/02/09/feature/index.html?wwwrrr_20000209.txt
A good place to start if you are interested in SOAP or XML-RPC for communicating with remote applications via XML.
XML JavaBeans: Part 1
http://www.javaworld.com/javaworld/jw-02-1999/jw-02-beans.html
JavaWorld article.
XML JavaBeans: Part 2
http://www.javaworld.com/javaworld/jw-03-1999/jw-03-beans.html
XML JavaBeans: Part 3
http://www.javaworld.com/javaworld/jw-07-1999/jw-07-beans.html
Design Patterns in XML Applications: Part 1
http://xml.com/pub/2000/01/19/feature/index.html?wwwrrr_20000119.txt
If you are familiar with design patterns, and article worth reading. If not, worth reading anyway before you design an XML DTD or Schema.
Design Patterns in XML Applications: Part 2
http://xml.com/pub/2000/02/16/feature/index.html?wwwrrr_20000216.txt
Top

References - Other

xml-dev Archive (new)
http://www.egroups.com/group/xml-dev/
The "xml-dev" mailing list is the #1 list for XML developers.
xml-dev: Archive (old)
http://www.lists.ic.ac.uk/hypermail/xml-dev/
XSL-List Archive
http://www.mulberrytech.com/xsl/xsl-list
The "XSL-List" mailing list is the #1 list for XSL developers and users.
Coins (JavaBeans serialised as XML)
http://www.jxml.com/coins/
Software for converting data between Java classes and XML documents.
CORBA & XML Resource Page
http://www.omg.org/xml/
Unicode
http://www.unicode.org/
The Unicode system for encoding the world's languages. Supported natively by XML and Java.
Source files for this seminar
../README.html
Top