Show XML structure using Velocity

sbarre5's Avatar


17 Feb, 2015 07:28 PM

Is it possible to get my XML structure to output using velocity? I'm a newbie and I'd like to see if the functions I'm using are actually picking up an XML structure or what I'm actually dealing with. It'd be similar to XSL copy-of a particular node.


  1. 1 Posted by Ryan Griffith on 17 Feb, 2015 07:33 PM

    Ryan Griffith's Avatar


    If you have an XML Element (eg from an Index Block), you can dump the element using the Serializer Tool's serialize method. For example:

    #set ( $page = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block/calling-page") )
    $_SerializerTool.serialize($page, false)

    This will grab the <calling-page> Element obtained from a calling page Index Block and will "dump" it to plain text.

    Please let me know if you have any questions.


  2. Ryan Griffith closed this discussion on 05 Mar, 2015 07:41 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac