<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
  <jsp:output omit-xml-declaration="yes" />

  <jsp:directive.attribute name="id" type="java.lang.String" required="true" description="The identifier for this tag (do not change!)" />
  <jsp:directive.attribute name="url" type="java.lang.String" required="true" description="The link URL" />
  <jsp:directive.attribute name="label" type="java.lang.String" required="false" description="The label used for this menu item" />
  <jsp:directive.attribute name="messageCode" type="java.lang.String" required="false" description="The global message code to be used (works in conjunction with label)" />
  <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
  <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" />

  <c:if test="${empty render or render}">

    <c:if test="${empty label}">
      <spring:message code="menu_item_${fn:toLowerCase(fn:substringAfter(id,'_'))}_label" var="label" />
    </c:if>

    <c:if test="${not empty messageCode}">
      <spring:message code="${messageCode}" var="label" arguments="${label}" />
    </c:if>

    <li id="${fn:escapeXml(id)}">
      <spring:url value="${url}" var="menu_item_url"/>
      <a href="${menu_item_url}" title="${fn:escapeXml(label)}">
        <c:out value="${label}" />
      </a>
    </li>

  </c:if>
</jsp:root>