Velocity sort XML file with dynamic-elements

Posted by shr_deadman on Stack Overflow See other posts from Stack Overflow or by shr_deadman
Published on 2009-11-03T08:56:58Z Indexed on 2010/05/12 15:04 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

Let's say I have a XML file wich looks like this:

<root>
  <dynamic-element name='name' type='text' repeatable='true'>
    <dynamic-element name='prename' type='text' repeatable='false'>  </dynamic
element>
  </dynamic-element>
</root>

In Liferay the XML file will be filled with input. At the and I will have multiple $name-elements. The question is how I can sort the elements before I print them out with

#foreach ($name in $name.getSiblings())
 $name.prename.getData() $name.getData()
#end

thanks, Matthew

© Stack Overflow or respective owner

Related posts about liferay

Related posts about velocity