避免在jstl中循环xml [英] Avoid looping xml in jstl

查看:66
本文介绍了避免在jstl中循环xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做这样的事情:

<x:out select="$productXML/product/sizes/size[<c:out value='${param.sizeIndex}'/>]" escapeXml="false"/>

但是我认为唯一的方法是这样的:

but I think the only way to do it is like this:

<x:forEach var="size" begin="${param.sizeIndex}" end="${param.sizeIndex+1}" select="$productXML/product/sizes/*">  
    <x:out select="$size" escapeXml="false"/>
</x:forEach>

有没有办法像我想要的那样做呢?

Is there a way to do it more like the way I want to?

推荐答案

由于GClaramunt [user 98867]使我处于正确的立场,所以我找到了正确的答案:

Thanks to GClaramunt [user 98867] putting me on the right tack, I discovered the correct answer:

<x:out select="$productXML/product/sizes/size[$param:sizeIndex]" escapeXml="false"/>

这篇关于避免在jstl中循环xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆