Using Java variables in Xtags select
Ashish Srivastava <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I am using xtags library in a JSP and am having
trouble using Java variables while selecting XML
nodes. The XML to be parsed is:
<xtags:parse id="parsed">
<parent id="1">
<child id="c1">
<class grade="art"/>
<class grade="science"/>
</child>
<child> ... </child>
</parent>
</xtags:parse>
<xtags:forEach context="<%=parsed%>"
select="//child[@id=<%=child_id%>/class">
...
</xtags:forEach>
Where child_id is a Java variable defined in the JSP.
The above code throws an exception complaining about
'<' in the expression. Even after escaping the
character it does not work. I even tried with indexing
like,
select="//child[i]/class"
where i is the index of the line. The problem is the
above select code returns all the child nodes instead
of the index=i. Seems like its null or something.
Help is highly appreciated.
Thanks,
-Ashish
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com