xml and xsl data grab for xhtml

wxdqz

New Member
I have a xml file which references a xsl stylesheet.

----xml---
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href=http://www.webdeveloper.com/forum/archive/index.php/"scrollertrial4.xsl"?>
<officers>
<officer URL="[email protected]">
<position>President</position>
<name>Someones Name</name>
<URL>mailto:[email protected]</URL>
<phone>555-555-1212</phone>
<extension>123</extension>
</officer>
</officers

---xsl---
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1" width="570" height="100%">
<tr>
<th align="center">Position</th>
<th align="center">Name</th>
<th align="center">Phone</th>
<th align="center">Ext</th>
</tr>
<xsl:for-each select="officers/officer">
<tr>
<td align="right" width="230"><font style="font-size:14px"><xsl:value-of select="position" /></font></td>
<td align="center" width="200"><font style="font-size:14px"><xsl:value-of select="name" /></font></td>
<td align="center" width="100"><font style="font-size:14px"><xsl:value-of select="phone" /></font></td>
<td align="center" width="40"><font style="font-size:14px"><xsl:value-of select="extension" /></font></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

First question is this...
1. within the xsl stylesheet, where it specifies the "name" field, I would like to add a URL reference to that so when i put the xml file in xhtml within an <iframe>, you can click on their name and it will open up email. Also on mouse over, it will hightlight in red and boldface it. How do i add that <a href> around <xsl:value-of select="name" /> referencing the URL field?

2. i need to use this xml file 2 ways. The first is to put into a long table with everyone's name and phone number per row -- assume 30 rows. The next is another <iframe> that calls the same data but takes just the first row and displays that each column on a line (eg. postion<br />name<br />phone+ext). How can i do both and have the <iframe> call it properly?

Anthony
 
Back
Top