tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kralidis,Tom [Burlington]" <Tom.Krali...@ec.gc.ca>
Subject JSP/JSTL set var problem
Date Fri, 04 Nov 2005 19:04:05 GMT

Hi,

I have an XML config file (attached) which I'd like to set a bunch of
JSP variables.

The xml config file is something like:

<config>
 <property name="city" value="Toronto"/>
 <property name="prov" value="Ontario"/>
...
</config>

Basically, I'd like to set variables with names in property/@name, and
value of property/@value.  So the above example would allow me to use
<c:out value="${city}"/> type of thing.

Here's my code snippet:

<c:import url="./config.xml" varReader="xmlSource">
 <x:parse var="doc" xml="${xmlSource}" scope="page" />
</c:import>

<x:forEach select="$doc/*[local-name()='config' and
namespace-uri()='http://devgeo.cciw.ca/owscat/etc/properties']/*[local-n
ame()='property' and
namespace-uri()='http://devgeo.cciw.ca/owscat/etc/properties']"
var="loc">
 <c:set var="@name" scope="page" value="@value"/>
</x:forEach>

Any idea on how to make this work?  I get no errors on output but the
values are not being set.

Thanks

..Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message