Transcript xml_chapter2-1
ACG 4401 Chapter 2 1
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)
A language used to create other languages Vocabularies Describes: Rules & Syntax
For Structuring Documents!
Does NOT describe tag names 3
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) 4
Tags Meta-data ▪ description of data enclosed within brackets ▪ <>, opening ▪ closing Element Opening tag, data, and Closing tag ▪
Parent Hierarchy Parent/Complex ▪ ▪ Does not enclose data Encloses/Contains other elements ▪
1.
2.
3.
The first line of an XML document must contain the prologue .
The main theme of the XML document – the must enclose all the other elements in the document. There can be only one root element.
root element Every element must have an closing tag name opening tag name <> and a and they must match (case sensitive).
Documents can have empty elements.
4.
5.
Elements must be ring to it).
properly nested convention or more properly a , that is you close the tag that was opened last – think of tags as using a LIFO LOFC Last Opened First Closed convention (though it doesn’t have quite the same Elements can have attributes .
▪ ▪ Attributes follow the opening tag name attributeName=“attributeValue” attributeName is not included in the closing tag
Every XML document starts with a prolog It lets the XML enabled processor know that this is an XML document to be processed
UCS Transformation Format—8-bit) is a variable-width encoding that can represent every character in the Unicode character set.
Comment
i l C h d
Universal Business Language 11
Organization for the Advancement of Structured Information Standards (OASIS) Complete XML based library of business documents 12
13
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
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
UBL Schema’s 16
UBL defines what the root element name is
Parent elements contain or enclose other elements Root (
Attributes are contained within an opening element tag <> attributeName=“attribute value” Name-pair value
Processes Covered
Sample Despatch Advice
22
Assume Customers place Pizza Order over phone What data is captured with order?
▪ ▪ Customer ▪ Phone# Name Address ▪ ▪ Order ▪ Items Delivery/Pickup Total Amount 23
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 24