ASP, XML/XSL, & The Google API

Well. I must say, work is keeping me busy. I started fooling around with the Google API a couple of days ago and have that pretty much down pat. It started simple enough then quickly turned a little more sophisticated. At first I was just parsing the XML/SOAP message returned by the API with ASP and MSXML2. Then I found out that using response converts the XML output from Google to UTF-16 instead of UTF-8. This wouldn’t be an issue if the XML returned contained standard characters. It took me quite some time to figure this out. Some searches would return fine and dandy while others would cause the script to crash (with little error information).

This is where XSL/XSLT comes in. This is making things a whole lot easier. It does all the work for me…instead of having search through ParentNodes/ChildNodes and such with ASP. Now all the ASP code does is read in the XML and XSL files then transforms them into HTML ready for output.

Files

google.xsl

XSL stylesheet

used to translate the SOAP/XML response to readable HTML. You’ll need a browser

that can read valid XML (like Mozilla or

Internet Exploder 5.x) to see this file.

google.asp
This is the ASP script used to parse the XML/XSL

files and transform them into HTML output.

2 thoughts on “ASP, XML/XSL, & The Google API

  1. I was tring to integrate google search with a education website.
    when it try it putting your page on iis web server
    it gives this error

    msxml3.dll (0x80072EFD)
    A connection with the server could not be established
    /google/test6.asp, line 66

    whats the matter with it?
    i tried so manythings it looks some problem with the configuration, can u help me solve this problem?
    manso0r

  2. manso0r (is that a ‘zero’ in your name? 74M3R)

    Could be several reasons your script is not working. I [found this page](http://www.aspfaq.com/show.asp?id=2173 "Try Google! You can find anything") relatively quickly searching on Google. It goes over the various methods and properties of the ServerXMLHTTP object. Oh thant’s another thing, you might try updagrading to msxml4 as well.