JSTL : xml Library - XPath expression ?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Med_Coyote
Posted On:   Monday, July 12, 2010 03:25 AM

Hi everyone, I have some issue understanding how the JSTL tag is working. I have a simple XML structure : foo1 bar1 etc1 foo2 bar2 etc2 ... I correctly import and parse my XML document in a $doc variable. But then, the XPath expression I want to use is supposed to return a NodeSet with several nodes, but when I use it in the following JSTL tag it seems that I can only get the first element of this NodeSet, because it is only printing "foo1" and not "foo1 foo2 ..." : If I am right, the tag with this expression should print all the contents, but it does no   More>>

Hi everyone,



I have some issue understanding how the JSTL tag is working.

I have a simple XML structure :

			


foo1
bar1
etc1


foo2
bar2
etc2

...




I correctly import and parse my XML document in a $doc variable. But then, the XPath expression I want to use is supposed to return a NodeSet with several nodes, but when I use it in the following JSTL tag it seems that I can only get the first element of this NodeSet, because it is only printing "foo1" and not "foo1 foo2 ..." :


		


If I am right, the tag with this expression should print all the contents, but it does not, it is only printing the first one. Can I manage to get the expected result without having to use a forEach loop ? I just want to get several nodes content, like the XPath expression alone would do...



Thanks,

Med.    <<Less
About | Sitemap | Contact