Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2006, 05:14 PM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search XMl File Problem :@


Iam trying this code for about 2 days. I can't find what is wrong, I just want to type a memeber name of family (in xml file) and then get the data about it...... plz help me(xml file is working fine)
<html>
<body>
<span>Find</span>
<input type="text" name="search" style="width=100; height=20"/>
<input type="button" onclick="find()"/>
<br>
<br>
<div id="Output"></div>

<script>

function find()
{
  var XMLDoc = new ActiveXObject("Msxml2.DOMDocument.3.0")
  XMLDoc.async = false
  XMLDoc.load("HosamTree.xml")
  var str="/family/person[name='"document.all.search.value"']"
  var n1=selectNodes(str)
  var tstr="<table><tr><td>name</td><td>gender</td><td>age</td><td>mstatus</td><td>firstson</td><td>secondson</td><td>thirdson</td><td>fourthson</td><td>fifthson</td></tr>"


for(var i=0;i<n1.length;i++)
{
tstr+="<tr>"
var cn=n1(i).childNodes
for(var j=0;j<cn.length;j++)
{
tstr+="<td>"+cn.item[j].text+"</td>"
}
tstr+="</tr>"
}
tstr+="/table>"
document.all.Output.innerHTML=tstr
}

</script>
</body>
</html>


 
Old February 1st, 2006, 05:16 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can you post the xml source?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace a text in XML file AyatKh XML 17 May 23rd, 2012 09:05 PM
Parse/Load/Search xml file size near about 1 GB sandeep_akhare XML 4 September 19th, 2006 04:47 AM
Problem to create an xml file from two xml files saurabh_inblore XSLT 1 April 12th, 2006 02:58 AM
Search and display fields in XML file kts_33 XML 5 September 28th, 2004 08:17 AM
Search and display fields in XML file kts_33 Classic ASP XML 1 September 22nd, 2004 05:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.