Hi,
I have two XML files and I am trying to display one xml file content into a html table and I'd like to click on one of its cells and according to the selected cell show a record from another xml file.
Something like this but with two XML files
<html>
<head>
<script type="text/javascript">
function testclick(field)
{
var row=field.rowIndex;
xmldso_list.recordset.absoluteposition=row;
td_title.innerHTML=xmldso_list.recordset("TITLE");
td_artist.innerHTML=xmldso_list.recordset("ARTIST");
td_year.innerHTML=xmldso_list.recordset("YEAR");
td_country.innerHTML=xmldso_list.recordset("COUNTRY");
td_company.innerHTML=xmldso_list.recordset("COMPANY");
td_price.innerHTML=xmldso_list.recordset("PRICE");
}
</script>
</head>
<body>
<xml id="xmldso_list" src="cd_catalog.xml"></xml>
<table border="1" bgcolor="yellow">
<tr align="left"><th>Title: </th><td id="td_title"></td></tr>
<tr align="left"><th>Artist: </th><td id="td_artist"></td></tr>
<tr align="left"><th>Year: </th><td id="td_year"></td></tr>
<tr align="left"><th>Country:</th><td id="td_country"></td></tr>
<tr align="left"><th>Company:</th><td id="td_company"></td></tr>
<tr align="left"><th>Price: </th><td id="td_price"></td></tr>
</table>
<p><b>Click on one of the CDs in the list:</b></p>
<table datasrc="#xmldso_list" border="1">
<thead>
<tr align="left">
<th>Title</th>
<th>Artist</th>
<th>Country</th>
<th>Company</th>
<th>Price</th>
<th>Year</th>
</tr>
</thead>
<tr align="left" onclick="testclick(this)">
<td><div datafld="TITLE" /></td>
<td><div datafld="ARTIST" /></td>
<td><div datafld="COUNTRY" /></td>
<td><div datafld="COMPANY" /></td>
<td align="right"><div datafld="PRICE" /></td>
<td><div datafld="YEAR" /></td>
</tr>
</table>
</body>
</html>
Hope you can help me
Thanks in advance
Oscar
I have two XML files and I am trying to display one xml file content into a html table and I'd like to click on one of its cells and according to the selected cell show a record from another xml file.
Something like this but with two XML files
<html>
<head>
<script type="text/javascript">
function testclick(field)
{
var row=field.rowIndex;
xmldso_list.recordset.absoluteposition=row;
td_title.innerHTML=xmldso_list.recordset("TITLE");
td_artist.innerHTML=xmldso_list.recordset("ARTIST");
td_year.innerHTML=xmldso_list.recordset("YEAR");
td_country.innerHTML=xmldso_list.recordset("COUNTRY");
td_company.innerHTML=xmldso_list.recordset("COMPANY");
td_price.innerHTML=xmldso_list.recordset("PRICE");
}
</script>
</head>
<body>
<xml id="xmldso_list" src="cd_catalog.xml"></xml>
<table border="1" bgcolor="yellow">
<tr align="left"><th>Title: </th><td id="td_title"></td></tr>
<tr align="left"><th>Artist: </th><td id="td_artist"></td></tr>
<tr align="left"><th>Year: </th><td id="td_year"></td></tr>
<tr align="left"><th>Country:</th><td id="td_country"></td></tr>
<tr align="left"><th>Company:</th><td id="td_company"></td></tr>
<tr align="left"><th>Price: </th><td id="td_price"></td></tr>
</table>
<p><b>Click on one of the CDs in the list:</b></p>
<table datasrc="#xmldso_list" border="1">
<thead>
<tr align="left">
<th>Title</th>
<th>Artist</th>
<th>Country</th>
<th>Company</th>
<th>Price</th>
<th>Year</th>
</tr>
</thead>
<tr align="left" onclick="testclick(this)">
<td><div datafld="TITLE" /></td>
<td><div datafld="ARTIST" /></td>
<td><div datafld="COUNTRY" /></td>
<td><div datafld="COMPANY" /></td>
<td align="right"><div datafld="PRICE" /></td>
<td><div datafld="YEAR" /></td>
</tr>
</table>
</body>
</html>
Hope you can help me
Thanks in advance
Oscar