Rominall 0 Posted May 1, 2014 Report Share Posted May 1, 2014 Ok, I'm new to XML and XSL. Ultimately I want to populate this table with filters based on user input but thought I'd start with the whole table. Here's a portion of my XML file <?xml version="1.0" encoding="UTF-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="XSLstylesheet.xsl"?><data-set> <rep> <RepID>12345</RepID> <Rep>SomeName</Rep> <Dept>PS</Dept> <Station>1</Station> <ClassDate>41593</ClassDate> <Agency>AGency</Agency> <EmAppr>y</EmAppr> </rep> <rep> <RepID>98765</RepID> <Rep>Another Name</Rep> <Dept>HC</Dept> <Station>2</Station> <ClassDate>41593</ClassDate> <Agency>Next Agency</Agency> <EmAppr>y</EmAppr> </rep> ... </rep></data-set> Here's my XSL: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <html> <body> <h2>Representatives</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Rep</th> <th>Rep ID</th> <th>Department</th> <th>Station</th> <th>Start Date</th> <th>Agency</th> <th>Out of Approval Queue</th> </tr> <xsl:for-each select="data-set/rep"> <tr> <td><xsl:value-of select="data-set/Rep"/></td> <td><xsl:value-of select="data-set/RepID"/></td> <td><xsl:value-of select="data-set/Dept"/></td> <td><xsl:value-of select="data-set/Station"/></td> <td><xsl:value-of select="data-set/ClassDate"/></td> <td><xsl:value-of select="data-set/Agency"/></td> <td><xsl:value-of select="data-set/EmAppr"/></td> </tr> </xsl:for-each> </table> </body> </html></xsl:template></xsl:stylesheet> When I run it, the table has the requesite rows but no data in the cells. ???? What did I do wrong? Quote Link to post Share on other sites
L8V2L 5 Posted July 5, 2014 Report Share Posted July 5, 2014 Do a small one cell example , then simple repeat the process. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.