I am trying to generate my first report using a SQL Query outputting XML & an XSLT transform.
Having looked at the XML generated, there seems to be <DocumentElement><QueryResults><XML_<guid> before the results
Cut from results pane:
<DocumentElement>
<QueryResults>
<XML_F52E2B61-18A1-11d1-B105-00805F49916B><Users Username="aarongclarke"><Roles Rolename="Newsletter"/><Roles Rolename="Registered Users"/><Roles Rolename="Subscribers"/></Users><Users Username="admin"><Roles
However the code I have doesn't work - can someone please help a newbie with this
Thanks
the query is:
SELECT Username, Rolename FROM Users
JOIN UserRoles ON Users.UserID=UserRoles.UserID
JOIN Roles ON UserRoles.RoleID=Roles.RoleID
ORDER BY Username, Rolename
FOR XML AUTO
and I am using the XSL template:
<?
xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/*/*/*">
<table>
<xsl:for-each select="Users">
<tr><td><b><xsl:value-of select="@Username"/></b></td></tr>
<xsl:for-each select="Roles">
<tr><td></td><td><xsl:value-of select="@Rolename"/></td></tr>
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>