xml & ubl acg 6415 chapter 2. extensible markup language - xml meta-language a language that can...

17
XML & UBL ACG 6415 Chapter 2

Upload: antonia-pope

Post on 29-Jan-2016

230 views

Category:

Documents


0 download

TRANSCRIPT

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

XML & UBL

ACG 6415

Chapter 2

Page 2: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal 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 Schema Document .xsd

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

Stylesheet .xsl Formatting instructions for data in the instance document

All XML documents must be well-formed....

Page 3: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

XML Rules – A well formed document

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

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

Every element must have an opening tag <> and a closing tag </>

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

Elements can have attributes. Attribute values are enclosed with “ ” and can have no spaces.

Page 4: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

Prolog and Comment

Every XML document starts with a prologIt lets the XML enabled processor know

that this is an XML document to be processed

<?xml version="1.0" encoding="UTF-8"?> Comment

<!-- A simplified UBL Catalogue document: SkipWhite.com, April 2008 -->

Page 5: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

XML Concepts Prolog

the first line of any XML based document <?xml version="1.0" encoding="UTF-8"?>

Element A Tag set (the tag name, its attribute and data)

<StudentName campus=“main”>John Smith</StudentName> Element Hierarchy

Root Element Contains (or encloses) all the other elements

Parent Element Contains other elements Used to represent information about one Instance of an entity

For example a customer order Child Element

Enclosed by Parent element Represents attributes describing the Parent Element

For example: customer name, date of order, items ordered, etc. Attributes

used to modify or clarify the data in an element <elevation>130</elevation> <elevation measureUnit = “meter”>130</elevation>

Page 6: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal 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 ElementParent Element

Child Elements

Page 7: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

Lets look at more xml

Some Twitter files https://twitter.com/statuses/friends/shornik.xml https://twitter.com/statuses/public_timeline.xml

Page 8: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

Deliver Service to Customer

Jimmy Jones AutoCareService RequestLet’s build an XML Instance Document for

thisWhat data do we need?

Test your XML (is it well-formed?)Open in BrowserOpen in Excel

Page 9: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

9

Merry Maids Narrative

http://acg6415.wikispaces.com/Deliver+Service+to+Customer

9

Page 10: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

UBL

Universal Business Language

Page 11: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

Root Element

The first element tag after the prologEncloses all other elementsUBL defines what the root element name

is<Catalogue> </Catalogue>

Page 12: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

Parent Elements

Parent elements contain or enclose other elements Root (<Catalogue> ) Parent of:

<ID> <Name> <IssueDate> <ProviderParty>

<Party> <PartyName> <PostalAddress>

<ReceiverParty> <Party>

<PartyName> <PostalAddress>

<CatalogueLine> What are the Parent elements within this element?

Page 13: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal 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 14: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal 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 15: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal 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: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

UBL Models

Processes Covered

Page 17: XML & UBL ACG 6415 Chapter 2. Extensible Markup Language - XML Meta-Language A language that can be used to create others (vocabularies) Universal Business

Despatch Advice (Shipping Notice)

Sample Despatch Advice