XML: Scripting for the Web and Beyond

HTML was written with 1 major objective in mind – to define a language that allowed the formatted display and presentation of information across as several platforms as achievable, be it text, graphics or even added flexibility through scripting languages to enable interaction within the browser; and server databases have caused an explosion in the volume of data available nowadays.

 

All is not well, though. Developers are struggling to maintain pace with the complexities of maintaining significant sites that are compatible across browsers, where a lot of the data is changing on a daily basis. There is also a lot of repetition of details both within a single website and across the Web as a entire and somehow the ends require to be tied up. Surely databases are the answer? Well, yes and no. True, a database can act as the shared source, but not everybody uses or has access to a specific database format. Enter stage right, XML – eXtensible Markup Language.

 

Why Yet another Language?

 

XML, like HTML, has its roots in the Standard Generalized Markup Language (SGML), but shares even a lot more of its features. A excellent limitation with HTML is that it has driven Web development down a 1-way street; content gets produced and displayed but it is very tough to later extract meaningful data from the mixture of tags and text.

 

Unlike HTML, XML has no fixed tags. The user ought to define tags that mark individual items of data within the file. XML holds the promise of a common source definition for the Web in significantly the same as Rich Text Files permit formatted text to be exchanged between distinct word processors.

 

How Does it Work?

 

The XML file will contain a list of names and addresses all appropriately ‘marked up’ with your chosen tags. It is typical also to define a Document Sort Definition (DTD), either within the exact same file or in a separate file that can be referenced by other XML files. The DTD is not important, but does allow the XML content to be validated and effectively interpreted by other users.

 

In addition to this, a style sheet is needed. This style sheet provides a template that defines how each of the elements in the XML file are to be displayed, by referencing the named tags in the XML file and embedding them within the required HTML formatting tags. A selection of style sheets can be used to define the look and feel of the resulting page. Most familiar will be Cascading Style Sheets (CSS), as employed with Dynamic HTML.

 

DSSSL (Document Style Semantic and Specification language), apart from being a mouthful, is powerful but tricky to get to grips with. Showing most promise for the future is XSL (eXtensible Style Language). It is the language that has been written specifically for XML, it has the power to provide handling and formatting of XML data and already has some direct browser support.

 

Pushing all of the display and formatting into the selected style sheet brings real benefits. Producing cross-browser content is tedious at the finest of times, but using the XML route only requires style sheets to be defined for every browser variant needed – no modification of the source files containing the text content and navigation is needed.

 

That’s not all – it gets far better. Making use of a single set of typical XML files, a range of various style sheets can be employed together with an suitable parser (which checks and processes the XML script) not only to produce HTML code for standard personal computer-based Web browsers but for all sorts of other applications.

 

A style sheet containing the necessary formatting and filtering of data for WAP can turn your XML Web content into WML (Wireless Markup Language) suitable for mobile phones, where only a little selected amount of details can be displayed. Alternatively style sheets could also render the XML for direct use with WebTV – the format commonly used for Digital Television, which, though sharing most of the features of standard HTML, is diverse enough to usually require separate development. It is even possible to produce widespread document kinds for distribution and other purposes – packages already exist for producing Acrobat PDF files direct from XML.

 

Browser Support

 

Direct support for displaying XML in the browser is limited regrettably. Microsoft 1st introduced XML support in version 4 of Internet Explorer via bolt-on XML and XSL parsers. At the moment IE7 with integrated XML support is the finest option. Until there is a critical mass of XML-aware browsers on the Web, your best way forward for XML development is to produce standard HTML from pre-processed XML and style sheets. This can be accomplished utilizing a parser either off-line or on-line on the server in real time.

 

Making Web pages a lot more data-aware via the use of XML has the potential of transforming the Web landscape. Huge organizations and businesses which are concentrating on the areas of on-line e-commerce, transaction processing and info sharing, require a frequent language and means of identification to work efficiently.

 

XML will also make integrating new technologies, such as speech recognition, easier for developers. As the Web expands and transforms itself, XML will only turn out to be far more crucial.

Both comments and pings are currently closed.

Comments are closed.