Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2008
    Location
    Australia
    Posts
    36
    Thanks
    5
    Thanked 0 Times in 0 Posts

    XML Generated List not searching?

    Hi all and thanks in advance....

    We run a Search engine called FunnelBack and we've generated a a list on the page through XML and for some reason this list isn't searching?

    This is the HTML and the way we render it on the page:
    Code:
    <table border="0" cellpadding="2" width="100%" cellspacing="0" class="policysort table-autosort:0 table-autofilter">
            <thead>
              <tr>
                <th width="85%" class="table-sortable:default" title="Click to sort by Name">Title</th>
                <th width="100px" class="table-sortable:default" title="Click to sort by Service Line">Code</th>
              </tr>
            </thead>
            
    <script language="javascript" runat="server">
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","include/medicine-docs.xml",false);
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML;
    
    
    var x=xmlDoc.getElementsByTagName("document");
    for (i=0;i<x.length;i++)
      {
    	  var title=x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
    	  var code=x[i].getElementsByTagName("code")[0].childNodes[0].nodeValue;
    	  var url=x[i].getElementsByTagName("url")[0].childNodes[0].nodeValue;
    	  
    	  document.write("<tr><td>");
    	  document.write("<a href='"+url+"'>"+title+"</a>");
    	  document.write("</td><td>");
    	  document.write(code);
    	  document.write("</td></tr>");
      }
    </script>
        </table>
    Any thought on how to get around the search engine not picking up the rendered list? Don't really want to make it an ASP or PHP to run at Server?

    Again thanks...

    Cheers
    D

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Oh, boy. Synchronous XML, and document.write()? Be prepared for performance problems.

    What's your XML look like with a valid search result?

    XSLT might be a good option to explore.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •