XML for Dummies

advertisement
GE Information Services
XML/EDI
XML for Dummies
Bill Cafiero
972-231-2180
jcaf@airmail.net
Copyright © William G. Cafiero, 2000
Page 1
GE Information Services
Session Outline
This Session has four sections:
1. Introductory Section - What is our problem
with EDI today?
2. Technical Section - The mechanics of XML
3. Current Development Section - What work
is underway at the present
4. Example Section - Looking at XML for X12
based EDI
A good web site for general XML information is
www.xmlinfo.com
Copyright © William G. Cafiero, 2000
Page 2
Section 1 - The Issue
GE Information Services
You receive the following transmission...
9.95
What the heck does this mean?
• Is it a length?
• Is it a weight?
• Is it a part number
• Is it a price?
Copyright © William G. Cafiero, 2000
Page 3
GE Information Services
Context for Data
But if you receive the following...
PO1*1*30*EA*9.95**VP*A-430\
Now it makes more sense. But why does it
make more sense?
• We see the 9.95 in a context (It is a
segment in an X12 purchase order)
• We have previously exchanged a set of
rules for this context (e.g. the X12
Standard for the PO1 Segment)
• The rules tell us the 4th field in a PO1
segment is a price!
Copyright © William G. Cafiero, 2000
Page 4
GE Information Services
The Problem
Then what’s the problem?
• Trading Partners need to make
prior arrangements
• Complex standards are
required
• Most Applications can’t
understand these rules so we
need Translator software
• It’s really tough for SME’s
Copyright © William G. Cafiero, 2000
Page 5
GE Information Services
XML
Suppose I transmit this instead...
Price=9.95
Does this make more sense?
• It’s clearly a price, not a weight or
length
• The label is human readable
(SME’s!!!)
• We don’t need prior discussion of
where the price is in a segment, or
even what segments are
Copyright © William G. Cafiero, 2000
Page 6
GE Information Services
XML Highlights
Data that in X12 is defined by its position in a
predefined structure is, in XML, given a label
(tag) that describes the data in the
transmission itself.
• We should probably agree on what the tags are
• We may or may not need to define how the
elements are organized or structured
• The data may be transmitted in any
communications protocol - it especially lends itself
to the Internet
• The data may be from application to application or
application to browser (human) or browser to
browser or even browser to application
This is the essence of XML!
Copyright © William G. Cafiero, 2000
Page 7
GE Information Services
Section 2 - The Technical Stuff
Let’s look at the details of XML...
With thanks to the following XML “experts”:
Jen-Yao Chung
Director, Technical Office, Institute for Advanced Commerce
IBM
R.T.Crowley
Senior Vice-President
Research Triangle Consultants
Larry Domeracki
Senior Consultant
GE Information Services
Copyright © William G. Cafiero, 2000
Page 8
GE Information Services
XML = eXtensible Markup Language
• XML is a standard open format for communities to
develop their own structured mechanisms for
marking-up text and data to facilitate the exchange
and manipulation of documents among the
community members
• XML and HTML both evolved from SGML
– XML is NOT HTML on steroids
• XML focuses on document exchange
• HTML focuses on document display
• All markup languages use tags “< >” and “</>” to
markup the text and data to provide information
about the information
• XML: designed to transfer structured text and data
among systems in multiple organizations
• XML 1.0 spec is available at www.w3.org
Copyright © William G. Cafiero, 2000
Page 9
GE Information Services
This is an XML document
<?XML version=“1.0”?>
<Basket>My Fruit Basket
<Oranges count=”5”/>
<Apples count=”1”>Macintosh</Apples>
</Basket>
Copyright © William G. Cafiero, 2000
Page 10
GE Information Services
Document Type Definitions
• Because we can create our own tags and
document structures using XML, we need a
mechanism for defining what the tags mean
and what the valid structure is.
• A DTD is where we declare our specific
elements tags.
• The DTD also is where we declare what
attributes each tag has
<!ELEMENT Basket ( Oranges | Apples | #PCDATA )+>
<!ELEMENT Oranges (#PCDATA)>
<!ATTLIST Oranges
count CDATA #REQUIRED>
PCDATA = Parsed Character Data
Copyright © William G. Cafiero, 2000
Page 11
GE Information Services
Tags, Elements and Attributes
• Tags are labels that tells an application or other agent to do
something to whatever is encased in the tags
<Price> is a “start” tag. </Price> is the closing or “end” tag
• An Element refers to both the tags plus the content (the stuff
between the tags). E.G.
<Price> 9.95 </Price>
• Any tag can have an Attribute that takes the form of
name/value pairs, <tagname attribute = “value”>
E.G. <BODY> ID = “Section 1” </BODY>
Note:
XML is case sensitive so that tags like <Basket>, <basket>,
and <BASKET> are all different
Copyright © William G. Cafiero, 2000
Page 12
GE Information Services
Viewing XML
What about displaying XML douments?
• XML itself does not describe how a document is to be
displayed for human interpretation (i.e., screen, paper,
audio)
• XML documents are just plan text files - you use a text
editor to create and view them but there’s no
formatting
• Cannot view formatted XML directly using version 4.x
browsers
– Need to convert XML document to HMTL (or some
other format)
• Internet Explorer 5 and Netscape Communicator 5
browsers will handle XML directly.
Copyright © William G. Cafiero, 2000
Page 13
GE Information Services
Style Sheets
What is a Style Sheet?
• You can combine a style sheet with an XML document
to display the document in a browser
• Style Sheets contain the rules that declare how the
document’s information, contained within in the tags
should appear or be interpreted by the user agent
(browser, printer, text-to-speech converter, etc.)
• Style Sheets are like “templates and styles” in MS Word
• Style sheets can be written in several languages
– Cascading Style Sheets (CSS) extensions to HTML
– Extensible Styling Language (XSL)
Copyright © William G. Cafiero, 2000
Page 14
GE Information Services
Implementing XML for EDI
• Much of today’s XML Software activity focuses on
development of XML parsers
• Microsoft, IBM, Datachannel, Web Methods, etc., basically
give away their parsers
• Most parsers are written in C++ and Java - objected-oriented
languages
• The basic parser reads an XML document, and breaks it up
into its elements and stores the information in a tree
structure
– It can only do this if the XML document is written to
comply with the XML 1.0 Specification
– If it succeeds, then the document is considered “wellformed”
• Some parsers also can read in a DTD, and validate the
document against the DTD description.
– These are called “validating” parsers
Copyright © William G. Cafiero, 2000
Page 15
GE Information Services
XML Processing
XSL
Processor
DTD
XML
Parser
XSL
Style Sheet
HTML
(e.g. Browser)
Other
(e.g. Directly into
Application)
XML
Data
Source
Copyright © William G. Cafiero, 2000
Page 16
GE Information Services
XML Parse Tree Example
Source Document
Bookshop.XML
Copyright © William G. Cafiero, 2000
Page 17
GE Information Services
Copyright © William G. Cafiero, 2000
XML Parse Tree Example
Page 18
GE Information Services
XML - Basic Concepts Summary
• XML is a markup language - version 1.0 by the W3C
organization
• Markup Language is a set of rules that defines what
the markup is, and how it defines the structure and
content of the document
• A DTD (Document Type Definition) contains the
markup rules for a particular set of documents - the
tags, the elements and attributes
• To markup a document, use the rules from the DTD to
label the data and text appropriately.
• Style Sheets contain the rules that declare how the
document’s information, contained within in the tags
should appear or be interpreted by the user agent
(browser, printer, text-to-speech converter, etc.)
Copyright © William G. Cafiero, 2000
Page 19
GE Information Services
Section 3 - Current Developments
Why use XML for E-Commerce?:
• XML bridges the gap between traditional EDI and Webbased applications.
• Most of high-tech industry has espoused XML:
– Virtually all new software from Microsoft, GEIS,
Netscape, IBM, and others are going to be enabled to
use XML.
• XML could make EC/EDI more available to the SME and
other non-traditional EDI users.
Many approaches are under development:
• BizTalk
• CommerceNet
• OASIS
• EDIFACT
• X12
• etc.
Copyright © William G. Cafiero, 2000
Page 20
GE Information Services
BizTalk
BizTalk (http://www.biztalk.org)
Microsoft has published a defacto “standard” for XML
documents as BizTalk Framework v1.0
• The Framework lays down guidelines for encoding
business documents using XML
• Documents described in approved schemas, pass
validation tests, and published on www.biztalk.org
can be called BizTalk Framework documents
• The documents must use the XML Data Reduced
Subset (XDR)
• BizTalk messages typically contain one document
along with additional information used by the
application
Copyright © William G. Cafiero, 2000
Page 21
GE Information Services
OASIS
OASIS (http://www.oasis-open.org/)
• OASIS is the Organization for the Advancement of Structured
Information Standards
• OASIS is an international non-profit, vendor neutral consortium
dedicated to accelerating industry adoption of application and
platform independent formats based on public standards such
as XML, SGML and CGM
• The consortium was founded in 1993 and was originally called
SGML Open
• The consortium’s work complements that of international
standards bodies such as the World Wide Web Consortium,
with a focus on making these standards easy to adopt and
practical to use in real-world open system applications
• OASIS members include Adobe, Boeing, Compaq, Commerce
One, Dun & Bradstreet, Fuji Xerox, GCA, IBM, Microsoft, NIST,
Novell, Reuters, Sabre, Software AG, STEP, Sun Microsystems,
Xerox plus approximately 75 other companies
Copyright © William G. Cafiero, 2000
Page 22
GE Information Services
Using XML for EDI
ASC X12:
X12 has proposed a possible methodology for representing
EDI semantics in XML syntax. The specific goals and
objectives include:
• Preserve semantic identities regardless of position within
the transaction set, appearance in different transaction
sets, and version/release of the standard. Any semantic
entity will retain a unique XML representation
• Provide a methodology for construction semantically
significant tags
• Achieve a balance between uniform structures for X12-XML
documents and interoperability between implementations
• Express transaction set structure explicitly with XML
structure
• Enable creation of “well-formed” XML documents
Copyright © William G. Cafiero, 2000
Page 23
GE Information Services
Using XML for EDI
UN/EDIFACT (http://www.ebxml.org):
• There are currently no UN/EDIFACT documents to describe
either a syntax or messages using XML
• UN/CEFACT and OASIS have formed a group called eb-XML
to take expert advice and study means for using XML for
conducting EDI internationally
• It can reasonably be expected any syntax and/or messages
shall satisfy international needs rather than being merely a
recast of the actions of other bodies
• The matter is progressing through the UN/CEFACT process
now and should be resolved soon
• Close watch is being placed upon the X12 efforts in this area
as a potential example of how a syntax might look
Copyright © William G. Cafiero, 2000
Page 24
GE Information Services
CommerceOne, Ariba and RosettaNet
Other approaches
• CommerceOne Common Business language (CBL)
http://www.commerceone.com
– Procurement and e-marketplace software
• Business description primitives like
companies, services and products
• Business forms like catalogs, purchase orders
and invoices
• Standard measurements, date and time,
location, classification codes
• Ariba cXML procurement http://www.ariba.com
• Industry coalition driven
– Healthcare, finance, accounting, automotive
– RosettaNet http://www.rosettanet.org, OBI
Copyright © William G. Cafiero, 2000
Page 25
GE Information Services
Object Orientated EDI
OO-EDI (“Future Direction of EDI” work in X12)
• An Open-EDI approach using Unified Modeling Language (UML)
models and object orientated technology
• A vision of future EDI characterized by:
– Structured/predefined information
– No prior agreements
– No human intervention
– Independence from underlying IT systems
– Supports cross sectoral exchanges
• Opportunity to lower barriers to electronic data exchange by
introducing:
– Standard business scenarios
– Services to support these standard scenarios
• Permit electronic processing of business transactions
– Among autonomous organizations
– Within and across sectors
Copyright © William G. Cafiero, 2000
Page 26
OO-EDI
GE Information Services
Future OO-EDI Implementation
Distributed Object Transport
(perhaps with XML)
In-house
Objects
In-house
Objects
OO-EDI
Scenarios
(UML Models)
Common
Business
Objects
Copyright © William G. Cafiero, 2000
Page 27
A Possible “Coming Together”
GE Information Services
Industry Consortiums
Core technology standards. XML,
Schema, DOM, XSL, namespaces,
linking, XHTML, RDF, XML Query
MRO Buying on the Internet
The XML Industry portal.
A vendor neutral XML
schema clearinghouse.
Info on how to apply XML
in industrial and
commercial settings
IT Supply Chain initiative
CBL
Accelerating the
adoption of industry
standards. 100+ member
companies
United Nations Centre for the
facilitation of Administration,
Commerce and Transport
ebXML
eXML
Copyright © William G. Cafiero, 2000
XML/EDI
Page 28
GE Information Services
Section 4 - X12 Example
Using XML with X12 based EDI
Copyright © William G. Cafiero, 2000
Page 29
GE Information Services
Defining Tags for XML/EDI
What’s in a name?
• Tarheel Systems (DUNS 2736541) is making a shipment from
one division of the company to another.
• Therefore, they need to be shown as the “shipper” in the
transaction set or message.
Copyright © William G. Cafiero, 2000
Page 30
GE Information Services
Defining Tags for XML/EDI (Cont.)
The X12 EDI Version:
• The N1 Segment
N1*SH*Tarheel Systems*1*2736541*07*SH
Copyright © William G. Cafiero, 2000
Page 31
GE Information Services
Defining Tags for XML/EDI (Cont.)
The XML Verbose Version:
<N1-Name>
<EntityIDCode>SH</EntityIDCode>
<Name>Tarheel Systems</Name>
<IDCodeQual>1</IDCodeQual>
<IDCode>2736541</IDCode>
<EntityRelationCode>07</EntityRelationCode>
<EntityIDCode>SH</EntityIDCode>
</N1-Name>
Copyright © William G. Cafiero, 2000
Page 32
GE Information Services
Defining Tags for XML/EDI (Cont.)
The XML Compact Version:
<XN1>
<X0098>SH</X0098>
<X0093>Tarheel Systems</X0093>
<X0066>1</X0066>
<X0067>2736541</X0067>
<X0706>07</X0706>
<X0098>SH</X0098>
</XN1>
Copyright © William G. Cafiero, 2000
Page 33
GE Information Services
Using XML for EDI
A Sample X12 EDI transaction in XML:
• A fellow named John Doe from Battle Creek, MI decides to
make a purchase using an X12-xml Purchase Order (TS850)
• He decides to purchase a hammer.
• The hammer costs $35.73 from the catalog.
• There is only one line item in the PO.
• No taxes will be added.
• No discounts will be taken.
• This is just a simple purchase order.
Copyright © William G. Cafiero, 2000
Page 34
GE Information Services
A Sample X12 EDI transaction in XML
<?xml version=“1.0”?>
<set850>
<set850-1-010>
<segST01>850</segST01>
<segST02>9999</segST02>
</set850-1-010>
<set850-1-020>
<segBEG01>00</segBEG01>
<segBEG02>SA</segBEG02>
<segBEG03>123456</segBEG03>
<segBEG05>19981001<segBEG05>
</set850-1-020>
<set850-1-310-loop>
<set850-1-310>
<segN101>ST</segN101>
<segN102>John Doe</segN102>
</set850-1-310>
<set850-1-330>
<segN301>281 Apple Street</segN301>
</set850-1-330>
<set850-1-340>
<segN401>Battle Creek</segN401>
<segN402>MI</segN402>
</set850-1-340>
Copyright © William G. Cafiero, 2000
Page 35
GE Information Services A Sample X12 EDI transaction in XML (cont)
</set850-1-310-loop>
</set850-2-010-loop>
<set850-2-010>
<segPO102>1</segPO102>
<segPO103>EA</segPO103>
<segPO104>35.73</segPO104>
<segPO106>GE</segPO106>
<segPO107>Hammer</segPO107>
</set850-2-010>
</set850-2-010-loop>
<set850-3-030>
<segSE01>7</segSE01>
<segSE02>9999</segSE02>
</set850-3-030>
</set850>
As you can see, an EDI transaction in XML can be VERY
verbose! (but the internet is “free” isn’t it)
Copyright © William G. Cafiero, 2000
Page 36
GE Information Services
What’s Next?
The Path Forward in X12:
• The X12 White Paper was presented at the October
1998 X12 Meeting for review.
• An X12 Project Proposal was submitted for the
creation of an X12 Technical Report as a reference
model for representing EDI data elements in XML.
• The X12 Technical Report is targeted to be out of
committee in June of 1999 after which it could be
considered as an X12 Standard.
But, as we saw this week, it looks like X12 will
support ebXML activities
Copyright © William G. Cafiero, 2000
Page 37
GE Information Services
Conclusion
Is XML the Answer for Future EDI?
• No single EC technology is an answer to everything in
and of itself.
• Each form of EC from XML through traditional EDI to
Imaging and Biometric ID Systems has a place in what
we do.
• The answer is NOT here yet. We still have a very long
way to go with all our technologies.
What is a Legacy System?
One that works!
Copyright © William G. Cafiero, 2000
Page 38
Download