This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ASP/XML/XSL Combo


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...
<polls>
 <poll>
  <question>Question Here</question>
 </poll>
</polls>

<%
      set dbDocument = Server.CreateObject("Microsoft.XMLDOM")
      set style = Server.CreateObject("Microsoft.XMLDOM")
	  set resultSet = Server.CreateObject("Microsoft.XMLDOM")
      dbDocument.async = false
      style.async = false
	     
      dbDocument.load("xml/Polls.xml")
      style.load("xsl/generic.xsl")
  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
       next
 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]