9

Introduction to XML

  • Upload
    asta

  • View
    21

  • Download
    0

Embed Size (px)

DESCRIPTION

Introduction to XML. This is not an XML class, but for those who do not know XML, here is a very brief introduction…. What is XML?. XML is a standard published by the W3C It is used to describe markup languages (“tag sets”) It is application- and platform-independent - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to XML
Page 2: Introduction to XML

Introduction to XML

This is not an XML class, but for those who do not know XML, here is a very

brief introduction…

Page 3: Introduction to XML

What is XML?

• XML is a standard published by the W3C• It is used to describe markup languages (“tag

sets”)• It is application- and platform-independent• It handles multiple character sets (unicode)• It is a text format which is easy to read

Page 4: Introduction to XML

How Does XML Work?

• XML takes a stream of text characters, and allows them to be interpreted as a tree structure– It combines the properties of documents with the

structure of object-oriented systems

Page 5: Introduction to XML

Text Text Text Text

Text

Text

Text

Text Text Text

= XML “element” Text = string, code, or number

Page 6: Introduction to XML

XML Elements

• XML elements have names, and a specific content which is described either in a DTD or (as for SDMX-ML) in an XML schema

• XML elements can contain other elements, or values, or both (or neither)

• They have a start tag <NameOfElement> and an end tag </NameOfElement>

• They can have additional properties, called attributes:

<NameOfElement NameOfAttribute=“ValueOfAttribute”>

Page 7: Introduction to XML

XML Elements (cont.)

• In an XML document, everything between an element’s start tag and end tag is contained in that element:

<ElemA><ElemB>Some Text</ElemB><ElemC>Some Other Text</ElemC>

</ElemA>• Here, ElemA contains ElemB and ElemC, which

in turn contain text.

Page 8: Introduction to XML

XML Documents

• XML documents have their exact contents (elements, attributes, numeric, string, and coded data) described in a separate XML file called an XML Schema

• XML documents can be validated with a generic processor called an “XML Parser”

• XML documents can be rendered into tree objects in memory, for processing, by many different software tools

Page 9: Introduction to XML

Why XML is so Popular

• XML is popular because:– it allows very complex sets of structured data to

be transmitted over the internet as a simple stream of characters (a document), but…

– It allows processing of that simple stream as a rich object model in the receiving application

• XML is ubiquitous on the Internet, and is the basis of all web-services applications