The What, Why, and How of XML [1/1]

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


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

What is XML? [1/18]


What is XML? [2/18]


What is XML? [3/18]


What is XML? [4/18]


What is XML? [5/18]

<html>...</html>

What is XML? [6/18]

<?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>

What is XML? [7/18]

<?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>

What is XML? [8/18]

<?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>

What is XML? [9/18]


What is XML? [10/18]

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

What is XML? [11/18]

<?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>

What is XML? [12/18]

<!-- 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)>

What is XML? [13/18]

<!-- 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
>

What is XML? [14/18]

<?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>

What is XML? [15/18]

<?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>

What is XML? [16/18]

  <!-- 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>

What is XML? [17/18]

  <!-- 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"/>

What is XML? [18/18]

  <!-- 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>

Why Use XML? [1/7]


Why Use XML? [2/7]


Why Use XML? [3/7]


Why Use XML? [4/7]


Why Use XML? [5/7]


Why Use XML? [6/7]


Why Use XML? [7/7]


How Do You Get Into XML? [1/1]


How - XML Viewers [1/4]


How - XML Viewers [2/4]


How - XML Viewers [3/4]


How - XML Viewers [4/4]

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

How - XML Editors [1/3]


How - XML Editors [2/3]


How - XML Editors [3/3]


How - XML Parsers [1/5]


How - XML Parsers [2/5]


How - XML Parsers [3/5]


How - XML Parsers [4/5]


How - XML Parsers [5/5]


How - XSL & XSLT [1/4]

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

How - XSL & XSLT [2/4]


How - XSL & XSLT [3/4]


How - XSL & XSLT [4/4]


How - XPath/XPointer/XLink [1/5]


How - XPath/XPointer/XLink [2/5]

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

How - XPath/XPointer/XLink [3/5]


How - XPath/XPointer/XLink [4/5]


How - XPath/XPointer/XLink [5/5]


How - XML in Databases [1/3]


How - XML in Databases [2/3]


How - XML in Databases [3/3]


How - XML and Objects [1/1]


How - Messaging in XML [1/1]


How - XML Repositories [1/3]


How - XML Repositories [2/3]


How - XML Repositories [3/3]


XML Tips [1/4]


XML Tips [2/4]


XML Tips [3/4]


XML Tips [4/4]


References - XML [1/1]

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.

References - XML Standards [1/3]

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.

References - XML Standards [2/3]

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.

References - XML Standards [3/3]

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.

References - XML Tools [1/4]

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.

References - XML Tools [2/4]

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.

References - XML Tools [3/4]

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.

References - XML Tools [4/4]

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.

References - XML Repositories [1/1]

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

References - Industry Schemas [1/1]

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/

References - Articles [1/1]

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

References - Other [1/1]

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

#Slides: 72