<?xml version="1.0"?>
<!-- default XSLT style sheet for the uiListing control (grid editing mode). 
     requires 2 global JS variables 'uiImgSelRow', 'uiImgSelRowOff' to be declared (image object) -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no"/>
<xsl:param name="imageUrl"></xsl:param>
<xsl:param name="hiRowClass">uiAlternatingRow</xsl:param>
<!-- <xsl:param name="DSO"></xsl:param> name of the data source object (XML island) default parameter -->
<xsl:param name="controlName">null</xsl:param><!-- name of the object representing this web control -->

  <xsl:template match="/">
    <table onclick="this.SelectRow();" border="1" style="behavior:url(ui/default/egridRowSelecting.htc); border-collapse:collapse;" cellPadding="0">
    <xsl:for-each select="//node">
	<xsl:sort data-type="text" order="descending"/>
	     <tr id="{generate-id()}_id_{@id}"><xsl:attribute name="class"><xsl:if test="position() mod 2 = 0"><xsl:value-of select="$hiRowClass" /></xsl:if></xsl:attribute>
		     <td class="uiSelRowIndicator"><img src="ui/default/icons/none.gif" width="6" height="9" id="uiRowArrow{generate-id()}_id_{@id}"/></td>		     		     
		     <td ><input id="" class="uiGridInput">
			      <xsl:attribute name="onchange">_uiEditGridUpdateDSO(_uiGetRowID(this.parentNode), 1, this.value,<xsl:value-of select="$controlName"/>)</xsl:attribute>
			      <xsl:attribute name="value"><xsl:value-of select="@title"/></xsl:attribute></input></td>
		     <xsl:apply-templates select="info"/>
		 </tr>
	</xsl:for-each>
    </table>
  </xsl:template>

  
  <xsl:template match="info">
  	  <td class="uiListItem"><input id="" class="uiGridInput">
	    <xsl:attribute name="onchange">_uiEditGridUpdateDSO(_uiGetRowID(this.parentNode), this.parentNode.cellIndex, this.value,<xsl:value-of select="$controlName"/>)</xsl:attribute> 
	    <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input></td>
  </xsl:template>
   
</xsl:stylesheet>
