Introduction to Server-Side XML

It sets the scene for server-side XML, and shows what you can do with it, by way of a parallel example done in ASP, PHP, and JSP (we have only included the first of the example sections here). The three chapters that follow this one in the book are case studies, which go into using XML with the three server-side languages mentioned above in much more detail.

This sample is taken from Chapter 8 "Introduction to Server-Side XML" of the glasshaus title "Practical XML for the Web".

ASP

Active Server Pages (ASP) is a framework that lets you combine one of a number of scripting languages (VBScript and JScript being the most popular choices) with an expandable set of software components. It's easy to learn, powerful enough for most mainstream server-side web development, and good on performance (since ASP files are compiled to native code, as opposed to JSP files, which are translated each time).

Advantages

·          Professional support available (at a price).

·          Extensively documented on MSDN (msdn.microsoft.com).

·          A large number of corporate intranets are already running on Windows NT/2000 servers, and ASP is ideal for intranet applications in these circumstances.

·          It's easy to learn for developers used to a Microsoft environment.

·          Although it isn't totally "free", it is widely available since it runs on all PWS or IIS servers, which are packaged free with most recent Windows operating Systems.

Drawbacks

ASP is closely linked to the Windows operating system, and Microsoft IIS web server. It is neither practical nor desirable to run a web site based on ASP on anything but a Windows-based server, so in this way, it is rather limiting.

XML Support

Extensive support for XML is provided for ASP and indeed any kind of programming on the Windows platform through Microsoft XML Core Services 4.0 (MSXML 4.0), which is a full API for the parsing, validation, and processing of XML documents. Previous versions of the parser were distributed with various versions of Internet Explorer and other products, but to get the full functionality of the latest version, it needs to be downloaded.

Download the latest version (MSXML 4.0, Service Pack 1) from: http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/766/msdncompositedoc.xml.

Microsoft's XML parser has gone through a number of generations, the latest of which has been renamed to reflect the fact that it is far more than just an XML parser. In previous versions, Microsoft have jumped the gun a bit and provided their own functionality, such as support for their own version of XPath and their own version of XSLT. However, in version 4.0 they have fully adhered to the W3C's recommendations and come up with a fully compliant validating parser and processor.

MSXML 4.0 supports the following:

·          The Document Object Model (DOM)  allows an XML document to be loaded into memory and manipulated. Nodes of the document can be read, written to, added, removed, moved, replaced etc.

·          The XML Path Language (XPath) 1.0  the querying language used to navigate XML documents. Support for the full W3C standard for XPath is provided, as well as support for Microsoft's earlier implementation. XSLT uses XPath for document navigation, as we saw in Chapter 5.

·          Extensible Stylesheet Language Transformations (XSLT) 1.0  the current W3C XML stylesheet language standard. Support remains for Microsoft's earlier XSL-WD implementation, though this should only be used for legacy applications (see Chapter 5 for more on these different XSLT versions).

·          The XML Schema definition language (XSD)  the current W3C standard for using XML to create XML Schemas. XML Schemas are used for the validation of XML documents, as an alternative to DTDs (we met both of these in Chapter 1).

·          The Schema Object Model (SOM), an additional set of APIs unique to MSXML for accessing XML Schema documents programmatically.

·          The Simple API for XML (SAX)  an alternative to the DOM for processing XML documents. It doesn't load the whole document into memory so its much more lenient on server resources, but it is also more limited in its functionality. We first met SAX in Chapter 1.

·          There is also a unique API for transferring documents over HTTP, which comes in versions optimized for client or server use. This is particularly useful for facilitating communication between disparate systems.

George Petrov

George PetrovGeorge Petrov is a renowned software writer and developer whose extensive skills brought numerous extensions, articles and knowledge to the DMXzone- the online community for professional Adobe Dreamweaver users. The most popular for its over high-quality Dreamweaver extensions and templates.

George is also the founder of Wappler.io - the most Advanced Web & App Builder

See All Postings From George Petrov >>

Comments

Be the first to write a comment

You must me logged in to write a comment.