Building a Parser

Of course, exactly how you create these parsers and load files into them will depend on which parser you are using and what language you use to write your programs. For this example, I’ve used the MSXML parser from Microsoft. You could use this parser on either the client or the server. I decided to write the examples using Active Server Pages (ASP) in VBScript.

It is easy to create a DOM parser in ASP. Here’s how you’d load a schema document, for example,

<% 
 set schemaDocument = Server.CreateObject(“MSXML2.DOMDocument”) 
 schemaDocument.async=false 
 schemaDocument.load(server.mapPath(“schema.xml”)) 
%> 

The set keyword is necessary because the schemaDocument variable is an object reference. Without it, VBScript will try to assign ...

Get Special Edition Using XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.