firepages
12-21-2002, 03:20 AM
Hi, using the stuff below I can view all the current contacts that are stored in the contacts.xml.
How would I go about showing 1 record at a time ? with next/previous button ? - I could do this with forms and javascript but I would love to try it via XML if possible, it has to be basic stuff though i.e. it has to work in IE !
note this does not work in Moz but I am just as happy with a x-browser solution if it will degrade to IE5 as this does.
any pointers very much appreciated.
contacts.xml.....
<?xml version="1.0" encoding="ISO-8859-1"?>
<CONTACTS>
<CLIENT>
<NAME>Joe</NAME>
<SURNAME>Blogs</SURNAME>
<COMPANY>JB inc</COMPANY>
<HTTP>http://jb.inc</HTTP>
<EMAIL>jb@jb.inc</EMAIL>
</CLIENT>
<CLIENT>
<NAME>Joanna</NAME>
<SURNAME>Bloggs</SURNAME>
<COMPANY>JBB.inc</COMPANY>
<HTTP>http://jbb.inc</HTTP>
<EMAIL>jbb@jbb.inc</EMAIL>
</CLIENT>
</CONTACTS>
<html>
<body>
<xml id="contacts" src="contacts.xml"></xml>
<table border="1" cellpadding="10" cellspacing="0" datasrc="#contacts">
<thead>
<tr>
<th>Name</th>
<th>Surname</th>
<th>Company</th>
<th>Site</th>
<th>Email</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="5">Contacts</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><span datafld="name"></span></td>
<td><span datafld="surname"></span></td>
<td><span datafld="company"></span></td>
<td><a href=<span datafld="http"></span><span datafld="http"></span></a></td>
<td><a href=mailto:<span datafld="email"></span><span datafld="email"></span></a></td>
</tr>
</tbody>
</table>
</body>
</html>
How would I go about showing 1 record at a time ? with next/previous button ? - I could do this with forms and javascript but I would love to try it via XML if possible, it has to be basic stuff though i.e. it has to work in IE !
note this does not work in Moz but I am just as happy with a x-browser solution if it will degrade to IE5 as this does.
any pointers very much appreciated.
contacts.xml.....
<?xml version="1.0" encoding="ISO-8859-1"?>
<CONTACTS>
<CLIENT>
<NAME>Joe</NAME>
<SURNAME>Blogs</SURNAME>
<COMPANY>JB inc</COMPANY>
<HTTP>http://jb.inc</HTTP>
<EMAIL>jb@jb.inc</EMAIL>
</CLIENT>
<CLIENT>
<NAME>Joanna</NAME>
<SURNAME>Bloggs</SURNAME>
<COMPANY>JBB.inc</COMPANY>
<HTTP>http://jbb.inc</HTTP>
<EMAIL>jbb@jbb.inc</EMAIL>
</CLIENT>
</CONTACTS>
<html>
<body>
<xml id="contacts" src="contacts.xml"></xml>
<table border="1" cellpadding="10" cellspacing="0" datasrc="#contacts">
<thead>
<tr>
<th>Name</th>
<th>Surname</th>
<th>Company</th>
<th>Site</th>
<th>Email</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="5">Contacts</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><span datafld="name"></span></td>
<td><span datafld="surname"></span></td>
<td><span datafld="company"></span></td>
<td><a href=<span datafld="http"></span><span datafld="http"></span></a></td>
<td><a href=mailto:<span datafld="email"></span><span datafld="email"></span></a></td>
</tr>
</tbody>
</table>
</body>
</html>