J
James Willmore
If this isn't the right newsgroup, please be kind when letting me know
I have the following in an XML file:
....
<section name="1">
<question name="1" required="true">
Describe what the Nominee did to be considered for an award
</question>
</section>
....
And have tried the following in a JSP page
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
....
<!-- Section 1 Questions (/form/section[@name='1']) -->
<table border="0" summary="Section 1">
<x:forEach select="$doc//*/section[@name='1']/question">
<x:set var="currentXML" select="string(@name)" />
<c:set var="current" value="Section ${currentXML}" />
<tr>
<td class="onlyCell"><xut select="@name" />. (<cut value="${current}" />)
<xut select="." />
</td>
</tr>
<tr>
<td class="onlyCell">
<textarea cols="78" rows="10" name="<cut value="${current}" />"><cut value="${param[${current}]}" /></textarea>
</td>
</tr>
</x:forEach>
</table>
....
The above code doesn't work because it's an invalid EL expression. I want
to be able to give the value entered back to the user if this required
section isn't filled in. The idea is this ... if the XML file changes, I
don't want to go and recode the JSP based upon the changes.
Is this possible using taglibs or do I need to examine a different way of
doing this?
Hopefully, this post makes sense
Jim
I have the following in an XML file:
....
<section name="1">
<question name="1" required="true">
Describe what the Nominee did to be considered for an award
</question>
</section>
....
And have tried the following in a JSP page
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
....
<!-- Section 1 Questions (/form/section[@name='1']) -->
<table border="0" summary="Section 1">
<x:forEach select="$doc//*/section[@name='1']/question">
<x:set var="currentXML" select="string(@name)" />
<c:set var="current" value="Section ${currentXML}" />
<tr>
<td class="onlyCell"><xut select="@name" />. (<cut value="${current}" />)
<xut select="." />
</td>
</tr>
<tr>
<td class="onlyCell">
<textarea cols="78" rows="10" name="<cut value="${current}" />"><cut value="${param[${current}]}" /></textarea>
</td>
</tr>
</x:forEach>
</table>
....
The above code doesn't work because it's an invalid EL expression. I want
to be able to give the value entered back to the user if this required
section isn't filled in. The idea is this ... if the XML file changes, I
don't want to go and recode the JSP based upon the changes.
Is this possible using taglibs or do I need to examine a different way of
doing this?
Hopefully, this post makes sense
Jim