Hi all,

I have a scenario where i need to load a template based on a XML file. I was
able to load it using the vm template.

Now i need to use xpath expression to get a section of xml document. Is
there a way to fetch portion of xml document using xpath expression.

I tried anakia, but still it is teasing.
eg:
#set ($studentList = $xpath.applyTo("document/student", $root))
#foreach( $student in $studentList)
$student
#end

When i use the above code in my vm template i'm able to get only the end
nodes and not the values.
o/p:
[Element: <student/>]
[Element: <student/>]
[Element: <student/>]

without using xpath expression i'm able to get the desired  o/p.

my xml file looks like this
<document>
        <student>
                <rno>1</rno>
                <name>Komal</name>
                <marks>
                        <mark>80</mark>
                        <mark>90</mark>
                </marks>
        </student>
       ...
       ...
<document>

-- 
View this message in context: 
http://www.nabble.com/populating-template-using-xml-tp25467258p25467258.html
Sent from the Velocity - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to