acg 4401 chapter 2 1. meta-language a language that can be used to create others (vocabularies)...

24
XML & UBL ACG 4401 Chapter 2 1

Upload: marlene-hall

Post on 22-Dec-2015

225 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

1

XML & UBLACG 4401 Chapter 2

Page 2: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Extensible Markup Language - XML

Meta-Language A language that can be used to create others

(vocabularies)▪ Universal Business Language (UBL)▪ Extensible Business Reporting Language (XBRL)

Application has sets of xml documents Instance Document .xml

▪ contains the data (chapter 2 & Chapter 4) Schema Document .xsd

▪ Describes allowed structure (data types, element names) of instance document (chapter 3)

Stylesheet .xsl▪ Formatting instructions for data in the instance document

(chapter 5)

Page 3: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

3

XML

A language used to create other languages Vocabularies

Describes: Rules & Syntax For Structuring Documents!

Does NOT describe tag names

Page 4: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

4

Well Formed vs. Valid

Well Formed documents meet basic rules for XML (chapter 2)

Valid documents Meets rules regarding structure, order

and data-types as described in Schema (chapter 3)

Page 5: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

5

XML Components

Tags Meta-data

▪ description of data enclosed within brackets▪ <>, opening▪ </> closing

Element Opening tag, data, and Closing tag

▪ <instructor>Dr. Hornik</instructor> Attribute

▪ Data that adds meaning to the data adding meaning to the data ▪ Data describing the tag▪ <Instructor Campus=“Main”>Dr. Hornik</Instructor>

Page 6: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

6

XML Element Types

Hierarchy Parent/Complex

▪ Does not enclose data▪ Encloses/Contains other elements

▪ <Instructor> <Name>Dr. Hornik</Name>

▪ </Instructor>

▪ Root Element▪ Encloses All other elements in Instance Document

Child/Simple▪ Encloses Data

▪ <Name>Dr. Hornik</Name>

ParentChild

Page 7: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

XML Rules – A well formed document

1. The first line of an XML document must contain the prologue.

2. The main theme of the XML document – the root element - must enclose all the other elements in the document. There can be only one root element.

3. Every element must have an opening tag name <> and a closing tag name </> and they must match (case sensitive).

Documents can have empty elements.

Page 8: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

XML Rules – A well formed document

4. Elements must be properly nested, that is you close the tag that was opened last – think of tags as using a LIFO convention or more properly a LOFC Last Opened First Closed convention (though it doesn’t have quite the same ring to it).

5. Elements can have attributes. Attributes follow the opening tag name

▪ attributeName=“attributeValue”

▪ attributeName is not included in the closing tag

Page 9: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Prolog and Comment

Every XML document starts with a prolog It lets the XML enabled processor know that

this is an XML document to be processed

<?xml version="1.0" encoding="UTF-8"?> UCS Transformation Format—8-bit) is a variable-

width encoding that can represent every character in the Unicode character set.

Comment

<!– Hello World -->

Page 10: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Element Hierarchy

<tourGuide><city>

<cityName>Belmopan</cityName><adminUnit>Cayo</adminUnit><country>Belize</country><population>11100</population><area>5</area><elevation>130</elevation><longitude>88.44</longitude><latitude>17.27</latitude><description>Belmopan is the capital of Belize</description>

<history>Belmopan was established following the devastation of the former capital ,Belize City, by Hurricane Hattie in 1965. High ground and

open space influenced the choice and ground-breaking began in 1966. By 1970 most government offices and operations had already moved to the new location.

</history></city>

</tourGuide>

Root element

Parent elementChild Elements

Page 11: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

11

UBLUniversal Business Language

Page 12: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

12

UBL

Organization for the Advancement of Structured Information Standards (OASIS)

Complete XML based library of business documents

Page 13: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

13

Order to Invoice Business Process

Page 14: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Reusable Elements

When possible UBL uses the same structure for elements in different documents

PostalAddress can be used in: Catalogue Purchase Order Invoice …

▪ So it has the same structure▪ <StreetName>Main St.</StreetName>

<BuildingNumber>56A</BuildingNumber> <CityName>Newark</CityName> <PostalZone>19716</PostalZone> <CountrySubentityCode>DE</CountrySubentityCode>

▪ <Country> ▪ <IdentificationCode>USA</IdentificationCode>▪ </Country>

Page 15: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

UBL document Rules

Each has a unique Root Element Each has a required ID

Uniquely Identify document Each has a required IssueDate

Determine when document is created Optional IssueTime

Each has two Party elements Provider/Supplier Customer/Buyer

Each has at least one line element CatalogueLine OrderLine

Page 16: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

16

UBL Order Rules (Schema)

UBL Schema’s

Page 17: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Root Element

UBL defines what the root element name is

<Order> </Order>

Page 18: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Parent Elements Parent elements contain or enclose other

elements Root (<Order> ) Parent of:

<ID> <SalesOrderID> <IssueDate> <IssueTime> <Note> <AccountingCostCode> <AccuntingCost> <BuyerCustomerParty>

▪ <Party>▪ <PartyName>▪ <PostalAddress>

<SellerSupplierParty>▪ <Party>

▪ <PartyName>▪ <PostalAddress>

<OrderLine>▪ What are the Parent elements within this element?

Page 19: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Element Attributes

Attributes are contained within an opening element tag <>

attributeName=“attribute value” Name-pair value

<PriceAmount currencyID="USD">575.55</PriceAmount> <BaseQuantity unitCode="UNIT">1</BaseQuantity>

Page 20: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

UBL Models

Processes Covered

Page 21: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

Despatch Advice (Shipping Notice)

Sample Despatch Advice

Page 22: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

22

Desptach Advice Rules

Page 23: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

23

Lets Build an XML Document Assume Customers place Pizza Order

over phone What data is captured with order?

Customer▪ Phone#▪ Name▪ Address

Order▪ Items▪ Delivery/Pickup▪ Total Amount

Page 24: ACG 4401 Chapter 2 1.  Meta-Language  A language that can be used to create others (vocabularies) ▪ Universal Business Language (UBL) ▪ Extensible Business

24

Creating XML Instance Document

In-class/Windows use NotePad Mac use TextWrangler You must use a Text Editor (not a word

processor) XML editor – Exchanger XML Lite (PC

and Mac) Testing XML

Open in Browser (IE, Firefox, Safari??) If it opens it’s well formed If you receive an error message it’s not