Finance

Charts

Statistics

Macros

Search

What should one know about the XML format with Excel VBA

XML (Extensible Markup Language) is an extensible markup language developed on the basis of SGML (Standard Generalized Markup Language — approved by the International Standards Organization (ISO) as standard ISO 8879:1986 in 1986) as a universal data representation format. This format allows completely different applications to exchange data over the Internet. The basis of XML documents, similar to SGML or, for example, HTML documents, consists of tags (or markers) — marks in the document that can be identified by angle brackets, for example, <p>, <h1>. Tags are codes that are used to define the structure of a document, its visual presentation, and the meaning of the data. Thus, in HTML documents tags serve to define data formatting, whereas in XML documents they serve to define the structure and meaning of the data.

It should be noted that XML provides more advanced capabilities compared to, for example, HTML, since it allows the creation of additional elements with which new data, objects, and their properties can be described and defined, separating the data from their presentation in HTML. This makes it possible to overcome the limitations of HTML in describing non-standard objects. XML has been officially adopted by the W3C (World Wide Web Consortium), which is responsible for standards related to the World Wide Web.

The XML language is platform-independent: any program that is designed to use XML can read and process XML data regardless of the operating system or hardware. Thanks to its universal representation format, XML data can be used in many Microsoft Office 2007 applications.

When working with documents in XML format, the following files may be specified:

  • a web page for viewing the resulting document (e.g., in HTML format);
  • an XSL file containing a description of the structure of the external representation of the document;
  • an XML file including the data that serves as the source for filling in the document;
  • an XSD file containing a description of the data structure, usually called a data schema. The data schema may not be separated into a distinct file but instead may be embedded directly into the XML file containing the data.

Such a structure is dictated by the logical separation of an XML document into separate parts: data (XML), data structure (XSD), and data presentation (XSL, for example, transformation into HTML format). Conceptually, all these files together form a single web document, which can be viewed using Internet Explorer 5 or higher. However, an XML file (possibly together with an XSD file) can be used by applications that recognize this data format, regardless of other parts of the document. For example, an HTML file may contain only a script that is activated when the page loads and then loads data onto the page from an XML source.

Separating the data themselves from their presentation (in HTML format) and placing them in a separate XML file enables other applications that understand this specially developed universal format to access and process data from such a document independently of its presentation. Separating data from their presentation also allows applications to apply different methods of displaying the same XML data using several different presentation schemas.

The XSD file is called an XML schema. Its content complies with the XML Schema Definition (XSD) standard, officially adopted by the W3C consortium. The XML schema file describes the structure of the data in a universal way, including information about element names, data types, element combinations, as well as element attributes. The XML schema defines the data model for XML format: it sets the rules for tags and text. The use of an XML schema ensures that data in XML format is correctly understood by other applications and properly transformed into other data formats.

The XML schema contains a description of the data but does not include a description of how they should be displayed in a viewer. Previously, CSS files were used to display data in HTML, containing the relevant information on presenting data in the Cascading Style Sheets language. However, this was not very convenient, as the developer also had to study CSS in addition to XML, and CSS does not provide sufficient tools for controlling data output. In modern applications, a more flexible tool is often used for describing the external representation of data: XSL (Extensible Stylesheet Language). It allows one to select exactly which data to display, specify the order of data elements, modify them, and add additional information. Moreover, this language is similar to XML: it uses tags similar to XML tags and HTML constructs to create a style template for data output. Note that to display XML data in Internet Explorer 5 or higher it is not necessary to attach CSS or XSL files, since this browser has its own default style description. Use your own stylesheet files to ensure a consistent appearance of your web pages based on XML data.

Within XSL, the following specification parts can be distinguished:

  • XSLT (XSL for Transformation) — the language for transforming styles, and
  • XSL-FO (XSL Formatting Objects) — a unified formatting language that preserves all document data within itself.
0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx