|
|
 |
| EAN.UCC System | Basic
of XML |
As you navigate the site you will find that there are not
only textual information resources but also practical ways to
get involved with XML initiatives and specific activities. These
are aimed at developing your basic understanding of XML and exploring
the relationships between XML and legacy technology, like Electronic
Data Interchange (EDI). This site will also introduce some of
the more significant XML standards activities that are taking
place around the globe.
|
|
 |
XML is the Extensible Markup Language. It is designed
to improve the functionality of the Web by providing more
flexible and adaptable information identification.
It is called extensible because it is not a fixed format
like HTML (a single, predefined markup language). Instead,
XML is actually a `metalanguage' -- a language for describing
other languages -- which lets you design your own customized
markup languages for limitless different types of documents.
XML can do this because it's written in SGML, the international
standard metalanguage for text markup systems.
XML is intended `to make it easy and straightforward to
use SGML on the Web: easy to define document types, easy
to author and manage SGML-defined documents, and easy to
transmit and share them across the Web.'
It defines `an extremely simple dialect of SGML which is
completely described in order to pass it between different
computing systems which would otherwise be unable the XML
Specification. The goal is to enable generic SGML to be served,
received, and processed on the Web in the way that is now
possible with HTML.'
`For this reason, XML has been designed for ease of implementation,
and for interoperability with both SGML and HTML'
XML is not just for Web pages: it can be used to store any
kind of structured information, and to enclose or encapsulate
information in to communicate. |
|
 |
XMLValidate is an enterprise-grade solution for validating
streaming XML documents or messages against an XML Schema
or DTD. This SAX-based implementation for run-time validation
provides organizations with the core component in developing
high bandwidth, XML-based processing. Its event-driven API
makes XMLValidate an ideal candidate for industry-grade processing
in a run-time environment, such as the financial community,
which must reliably process between 10-20 million transactions
a day.
Example
The XML shown
below is both Well Formed and Valid according to the following
DTD.
<
?xml version="1.0"?>
< !DOCTYPE HelloWorldDTD [
< !ELEMENT HelloWorld (To,From,Content)>
< !ELEMENT To (#PCDATA)>
< !ELEMENT From (#PCDATA)>
< !ELEMENT Content (#PCDATA)>
]>
< HelloWorld>
<
To>Fred</To>
<
From>Jim</From>
<
Content>Hello</Content>
< /HelloWorld>
In this example the XML conforms to the syntactical rules
of XML as well as conforming to the internal DTD. From the
example above the <!DOCTYPE HelloWorldDTD[….]> effectively
says this is a DTD and it is called "HelloWorldDTD".
The next line <!ELEMENT HelloWorld (To,From,Content)> lists
the elements which will appear in the basic XML, in this
case they are "To", "From" and "Content".
The DTD then details each element and what data will be expressed
within that element. So the following specifies that this
element called "To" will contain Parser Character
Data (PCData) only <!ELEMENT To ( #PCDATA)>.
For more information on DTDs of Schema please see the appropriate
pages of this website. |
|
 |
A DTD is a formal description in XML Declaration Syntax
of a particular type of document. It sets out what names
are to be used for the different types of element, where
they may occur, and how they all fit together. For example,
if you want a document type to be able to describe Lists
which contain Items, the relevant part of your DTD might
contain something like this:
<!ELEMENT List (Item)+>
< !ELEMENT Item (#PCDATA)>
This defines a list as an element type containing one or
more items (that's the plus sign); and it defines items as
element types containing just plain text (Parsed Character
Data or PCDATA). Validating parsers read the DTD before they
read your document so that they can identify where every
element type ought to come and how each relates to the other,
so that applications which need to know this in advance (most
editors, search engines, navigators, databases) can set themselves
up correctly. The example above lets you create lists like:
<List><Item>Chocolate</Item><Item>Music</Item><Item>Surfing</Item></List>
How the list appears in print or on the screen depends on
your stylesheet: you do not normally put anything in the
XML to control formatting like you had to do with HTML before
stylesheets. This way you can change style easily without
ever having to edit the document itself.
A DTD provides applications
with advance notice of what names and structures can be
used in a particular document type.
Using a DTD when editing files means you can be certain
that all documents which belong to a particular type will
be constructed
and named in a consistent and conformant manner. DTDs are
less important for processing documents already known to
be well-formed, but they are still needed if you want to
take advantage of XML's special attribute types like the
built-in ID/IDREF cross-reference mechanism. |
|
 |
An XML Schema really acts like a data map to explain the
basic XML documents with which it is associated. The purpose
of a Schema is to define the allowable building blocks in
exactly the same manner as a DTD, however Schema development
has been informec from the application of DTDs in the B2B
arena and as a result are more advanced. They provide a means
of specifying element content in terms of data types such
a provision can be made for validating the content of elements
as well as the mark-up itself.
Schemas, unlike DTDs are written in XML avoiding the need
for processing software to be able to read DTD syntax, called
Declaration Syntax. This makes schemas easier to learn than
DTDs and in turn reduces development time while simultaneously
reducing the burden on software which otherwise needs to
interpret two distinct syntaxes.
Schemas are also easier to extent than DTDs, which makes
them more re-usable, and therefore a good foundation for
standardising business documents. The concept of re-usability
is an important one as it will allow the basic building blocks
of business exchanges to be standardised facilitating greater
interoperability than exists today.
Schemas also support namespaces which are an important aspect
of the XML syntax. They allow the developer/user to identify
their unique extensions to a particular XML document. This
is important when we consider the flexibility of XML to extensions,
as namespaces will be one mechanism by which extensions can
be managed. Allowing communities to trace who and why a document
was extended.
For example within a particular business community it may
be necessary, because of a particular business process to
add an additional address field to the description of Party.
This is easily achieved by the flexibility of XML schemas
and indeed XML, but by using a namespace this extension can
be uniquely attributed to a single user. |
|
|