1 / 20

XML & UBL

XML & UBL. ACG 4401 Chapter 2. 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

yetta
Télécharger la présentation

XML & UBL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML & UBL ACG 4401 Chapter 2

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

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

  4. Well Formed vs. Valid • Well Formed follows documents meet basic rules for XML (previous slide) • Valid • Meets rules regarding structure, order and data-types as described in Schema

  5. 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"?> • Comment <!-- A simplified UBL Catalogue document: SkipWhite.com, April 2008 -->

  6. XML Components • Tags • Meta data description of data enclosed within brackets <>, opening or </> 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> • Hierarchy • Parent • Does not enclose data • Encloses/Contains other elements • <Instructor> • <Name>Dr. Hornik</Name> • </Instructor> • Root Element • Encloses All other elements in Instance Document • Child • Encloses Data • <Name>Dr. Hornik</Name>

  7. Element Terminology • Parent Element = Complex Element • Child Element = Simple Element • (exception Chapter 3)

  8. Parent Element Root Element 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> Child Elements

  9. Lets look at more xml • Some Twitter files • https://twitter.com/statuses/friends/shornik.xml • https://twitter.com/statuses/public_timeline.xml

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

  11. Creating XML Instance Document • Will use NotePad • You can use any Text Editor • 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

  12. UBL Universal Business Language

  13. UBL Order Rules (Schema) • UBL Schema’s

  14. Root Element • UBL defines what the root element name is • <Order> • </Order>

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

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

  17. Element Attributes • Attributes are contained within an opening element tag <> • attributeName=“attribute value” • Name-pair value • <PriceAmountcurrencyID="USD">575.55</PriceAmount> • <BaseQuantityunitCode="UNIT">1</BaseQuantity>

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

  19. UBL Models Processes Covered

  20. Despatch Advice (Shipping Notice) • Sample Despatch Advice

More Related