• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 20. SVG and XSLT > Server-Side Transformations

Server-Side Transformations

Very little code is needed on the server to run a transformation. The JScript in Listing 20.10 uses MSXML 4.0 to apply the style sheet we've just been looking at to a local copy of source.htm (refer to Listing 20.1). We simply create a DOM document to contain the source data and a DOM document to contain the style sheet and then use one of the source document's methods to carry out the transformation. The source and style sheet files are in the same directory as this ASP file, and we address them with the help of a Server method to obtain the correct path. The transformation method we are using here is transformNode(). It returns a string, which we write to the Response object after setting the MIME type. If we point a browser at slide01.asp (Listing 20.10), we will be presented with the SVG as shown in Figure 20.2.

NOTE

MSXML 4.0 is a DLL that provides core XML functionality on Microsoft platforms, including parsing and XSLT. For more information, see http://msdn.microsoft.com/downloads.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint