XSL Question

webmasterbeta

New Member
I've got a simple XML structure that looks like the following:<xml id="xmlTest" name="xmlTest"><?xml version='1.0'?><MiscGrid><RowItem><RecordNumber>89</RecordNumber><FormID>1</FormID><FormName>Driver Exclusion</FormName></RowItem><RowItem><RecordNumber>101</RecordNumber><FormID>2</FormID><FormName>Mobile Equipment</FormName></RowItem></MiscGrid></xml>I'm using the following XSL to convert this structure into an HTML table:<?xml version="1.0"?><xsl:template xmlns:xsl="http://www.w3.org/TR/WD-xsl"><form id="frmTest"><table border="1"><xsl:for-each select="MiscGrid/RowItem"><tr><td><span id="spnTest"><xsl:value-of select="RecordNumber"/></span></td><td><xsl:value-of select="FormID" /></td><td><xsl:value-of select="FormName" /></td><td><input id="txtDelete" type="button" value=http://forums.devx.com/archive/index.php/"Delete" onClick="Delete()"/></td></tr></xsl:for-each></table></form></xsl:template>I want to be able to add the contents of element "RecordNumber" inside the"onClick=Delete()" so it will have the record number inside the functioncall like this: onClick=Delete(89), and the next row would have onClick=Delete(101),and so on. I'm not sure how to do this using XSL. Can someone help me?Otherwise, I'll have to resort back to building the table manually in ASPby traversing through the tree, etc., etc. Using XSL seems like such a cleanerapproach.Thanks in advance,Richard
 
Back
Top