90 likes | 212 Vues
This introduction provides essential insights into XML (Extensible Markup Language), a W3C standard used for describing markup languages. Learn how XML functions by organizing data into a tree structure, making it application- and platform-independent. Explore XML elements, syntax, and the significance of documents and schemas. Discover why XML remains popular for transmitting complex structured data over the internet and its role in web services. This guide is perfect for anyone looking to grasp the fundamentals of XML without delving into technical classes.
E N D
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 • It handles multiple character sets (unicode) • It is a text format which is easy to read
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
Text Text Text Text Text Text Text Text Text Text Text = XML “element” = string, code, or number
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”>
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.
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
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