Download presentation
Presentation is loading. Please wait.
Published byHenry Chapman Modified over 9 years ago
1
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part 2: Introduction to XML
2
2 Outline HTML, XML, and XBRL Technical Specification of HTML Names and Contents of XML Tags XML Syntax – XML Syntax - Attributes – XML Schema – XML Namespaces – XML Validation – XML Display
3
3 HTML, XML, and XBRL HTML stands for Hyper Text Markup Language. XML stands for EXtensible Markup Language. HTML was designed to display data and to focus on how data looks on the Web. XML was designed to describe and structure data, and to focus on what data is, i.e., XML is about describing information. XBRL is an XML Derivative. It is a global e- business language for supply chain management and business and financial reporting.
4
4 Technical Specification of HTML HTML has fixed number of predefined tags related to how text and other elements are to be displayed on the Web Names and Contents of Tags in HTML – Names are encased in angle brackets such as: for bold – The contents are usually written between the opening tag such as “ ”and the correspond closing tag – The data displayed are stored inside the HTML document Examples: This is bold, This is italics The web Browser will display as: This is bold This is italics
5
5 Names and Contents of XML Tags In XML, data can be stored in separate XML files. Thus, the same data file can be used for displaying in different formats XML tags are not predefined. Users define them For example: Joe Curious “name” enclosed between “ ” is the tag for name and represents the opening tag and “ ” represents the corresponding closing tag. The content of the element is “Joe Curious”, which is enclosed between the opening tag and closing tag
6
6 XML Name Restrictions for Elements Names must starts with a letter or a underscore “_”. Names can contain any combination of letters, numbers, underscores “_”, dashes “-”, or periods “.” Names must not contain any other characters. Names must not start with letters xml (or XML or Xml..). Names cannot contain spaces. All elements names (tags) are case sensitive, e.g., and are two different elements (tags).
7
7 XML Example of a customer list Joe Curious 525 Station Road Lawrence Kansas 66047 USA
8
8 XML Syntax The first line in the document is the XML declaration. It defines the XML version of the document. The next line describes the root element of the document. There can be only one root element in an XML document. An element may contain other elements, e.g., The element contains other elements such as,, etc.
9
9 XML Syntax If an element has no content, say, then it can be expressed as: either Or All tags must be properly nested. Elements are related as parent/child and siblings. – is parent of,, and other elements –,, are siblings.
10
10 XML Syntax - Attributes Elements may have additional information associated with them. This additional information can be expressed as attributes of the element Attributes must be included next to the name of the element in the opening tag. An element can have multiple attributes written one after the other with no significance attached to the order. The value of the attribute is written within quotes, using either single or double quotes.
11
11 XML Attributes – An Example Joe Curious 525 Station Road Lawrence Kansas 66047 USA
12
12 An Alternative to Attribute Joe Curious male 55 525 Station Road Lawrence Kansas 66047 USA
13
13 Document Type Definition (DTD) and XML Schema DTD and XML Schema are the two methods used to define elements, attributes, and the type of content (value) of an element allowed in the XML document XBRL uses XML Schema XML Schema defines the elements, their attributes, relationships, and the type of contents XML Schema describes the vocabulary of an XML document A single XML document may use multiple XML Schemas, i.e., multiple vocabularies
14
14 XML Namespaces Namespaces are used to distinguish between two or more distinct XML Schemas (XML Vocabularies) Why use namespaces? It allows one to use more than one vocabulary in a single XML document. Example Vocabulary 1 (one XML Schema): Joe Curious 525 Station Road Lawrence Kansas 66047 USA Vocabulary 2 (another XML Schema): Joan Courteous 325 Turnberry Dr, Lawrence, KS 66047, USA
15
15 XML Namespaces Namespaces are declared as special namespace attributes, e.g., xmlns:prefix=“namespace name”. Prefix is used as short form of the namespace name in an XML document Traditionally a namespace name is expressed as: xmlns:prefix=“http://www.somename.com/xyz1” Example <customerList xmlns:v1=“http://www.Lawrenceberry.com/schema1” xmlns:v2=“http://www.Lawrenceberry.com/schema2”> Joe Curious 525 Station Road Lawrence Kansas 66047 USA Joan Lee 5 Angela, Lawrence, KS 66047, USA
16
16 XML Validation Two levels of validation Level 1 validation is called “Well Formed” XML document – A “Well formed" XML document complies with the basic syntax and structural rules of the XML Specifications. – This validation does not check whether the name is correct or the attribute is correct or the content is of the right type. Level 2 validation is called “valid XML” – An XML document is “valid XML” if it conforms to the XML Schema. This level of validation checks to see whether the elements, attributes, and contents of the elements are valid in accordance with the XML Schema
17
17 XML Display XML documents can be displayed on the web and viewed through the Internet browser. In order to view an XML document through an Internet browser (similar to HTML document), one needs to use CSS (Cascading Style Sheets) or XSL (Extensible Stylesheet Language).
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.