What Is XML? Oracle Fusion Middleware Online Documentation Library
2
XML Overview 2-1
2
XML Overview
The following sections provide an overview of XML technology and the WebLogic Server XML subsystem:
■
Section 2.1, What Is XML?
■
Section 2.2, How Do You Describe an XML Document?
■
Section 2.3, Why Use XML?
■
Section 2.4, What Are XSL and XSLT?
■
Section 2.5, What Are DOM and SAX?
■
Section 2.6, What Is the Streaming API for XML StAX?
■
Section 2.7, What Is JAXP?
■
Section 2.8, Common Uses of XML and XSLT
2.1 What Is XML?
Extensible Markup Language XML is a markup language used to describe the content and structure of data in a document. It is a simplified version of Standard
Generalized Markup Language SGML. XML is an industry standard for delivering content on the Internet. Because it provides a facility to define new tags, XML is also
extensible.
Like HTML, XML uses tags to describe content. However, rather than focusing on the presentation of content, the tags in XML describe the meaning and hierarchical
structure of data. This functionality allows for the sophisticated data types that are required for efficient data interchange between different programs and systems.
Further, because XML enables separation of content and presentation, the content, or data, is portable across heterogeneous systems.
The XML syntax uses matching start and end tags such as name and name to mark up information. Information delimited by tags is called an element. Every XML
document has a single root element, which is the top-level element that contains all the other elements. Elements that are contained by other elements are often referred to as
sub-elements. An element can optionally have attributes, structured as name-value pairs, that are part of the element and are used to further define it.
The following sample XML file describes the contents of an address book: ?xml version=1.0?
address_book person gender=f
nameJane Doename
2-2 Programming XML for Oracle WebLogic Server
address street123 Main St.street
citySan Franciscocity stateCAstate
zip94117zip address
phone area_code=415555-1212phone person
person gender=m nameJohn Smithname
phone area_code=510555-1234phone emailjohnsmithsomewhere.comemail
person address_book
The root element of the XML file is address_book. The address book currently contains two entries in the form of person elements: Jane Doe and John Smith. Jane
Does entry includes her address and phone number; John Smiths includes his phone and email address. Note that the structure of the XML document defines the phone
element as storing the area code using the area_code attribute rather than a sub-element in the body of the element. Also note that not all sub-elements are
required for the person element.
2.2 How Do You Describe an XML Document?