[xsl] ASP/XML/XSL Combo

Subject: [xsl] ASP/XML/XSL Combo
From: "Robert Dahnke" <robert.dahnke@xxxxxxxx>
Date: Sat, 09 Jun 2001 07:03:53 +0800
I need to search an XML document for text with ASP (Serverside) and I was wondering what was wrong with this code.

The structure of the XML document is...
  <question>Question Here</question>

      set dbDocument = Server.CreateObject("Microsoft.XMLDOM")
      set style = Server.CreateObject("Microsoft.XMLDOM")
	  set resultSet = Server.CreateObject("Microsoft.XMLDOM")
      dbDocument.async = false
      style.async = false
  Set objRootElement = resultSet.createElement("polls")
  resultSet.appendChild objRootElement
   function DoSearch(searchStr)

    set docRoot = dbDocument.documentElement

   set polls = docRoot.selectNodes("/polls/poll")
      for each i in polls  

       set poll = polls.item(i)
       set question = poll.selectSingleNode("question")
         if ( question.text.search(searchStr) ) Then 
		 set cloneTree = poll.cloneNode(true)
         objRootElement.appendChild cloneTree

		  end if
 end function

  call DoSearch("Expansion")

  Response.Write objRootElement.transformNode(style)


Make PC-to-Phone calls with Net2Phone.
Sign-up today at: http://www.net2phone.com/cgi-bin/link.cgi?121

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread