<?xml version="1.0" encoding="UTF-8"?>
<maxdQL version="0.1" name="ListATableFormatted" >
	<description>List the entries for a given table (with formatting)</description>
	
	<xfunction id="formatBrowseSimple" comment="formats a list of entries from a browse output">
		<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
			<xsl:output method="xml" encoding="ISO-8859-1" indent="no" omit-xml-declaration="yes"  media-type="text/html" />
			<xsl:template match="/">
				<ul>
					<xsl:for-each select="//browse/*">
						<li><xsl:value-of select="@Name"/></li>
					</xsl:for-each>
				</ul>
			</xsl:template>
		</xsl:stylesheet>
	</xfunction>
	
	<arguments type="user">  
		<var name="TableName" comment="the table name you wish to retrieve entries for" />
	</arguments>
	
	<query id="1" name="ListTable" comment="list entries in a table" type="maxdBrowse" >
		<table uref="user" name="TableName" />
		<action>browse</action>
		<ids>*</ids>
		<attributes>no</attributes>
	</query>
	
	<query id="2" name="DisplayResults" type="export" >
		<h1>Your Results</h1>
		<h2 xref="formatBrowseSimple" processResultID="1" />
	</query>

</maxdQL>
