<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root	xmlns:jsp="http://java.sun.com/JSP/Page" 
				xmlns:c="http://java.sun.com/jsp/jstl/core" 
				xmlns:fe="http://www.emdt.ardeo.net/jsp/fe"
				version="2.0">
	<jsp:directive.page contentType="text/html" />
	<fieldset>
		<fe:forEach var="pageElement" element="${currentElement}">
			<c:choose>
				<c:when test="${pageElement.nodeName == 'label' and pageElement.firstChild != null}">
					<legend><c:out value="${pageElement.firstChild.nodeValue }"/></legend>
				</c:when>
				<c:when test="${pageElement.nodeName == 'group'}">
					<c:set var="currentElement" value="${pageElement}" scope="request"/>
					<jsp:include flush="true" page="group.jsp"/>
				</c:when>
				<c:otherwise>
					<fe:getAttribute var="class" element="${pageElement}" attribute="class"/>
					<c:if test="${class == 'input'}">
						<fe:formElement var="fe" element="${pageElement}"/>
							<table style="width: 100%">
								<tr>
									<td class="label" style="width: 35%"><c:out value="${fe.label }"/></td>
									<td class="input">
										<c:set var="currentElement" value="${pageElement}" scope="request"/>
										<jsp:include flush="true" page="${currentElement.nodeName}.jsp"/>
									</td>
								</tr>
							</table>
					</c:if>
				</c:otherwise>
			</c:choose>
		</fe:forEach>
	</fieldset>
</jsp:root>