Created
February 16, 2012 17:34
-
-
Save knice/1846629 to your computer and use it in GitHub Desktop.
Atom 1.0 Velocity Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Get atom feed from a feed block | |
| #set ($feed = $_XPathTool.selectSingleNode($contentRoot,"/feed")) | |
| ## Try to get entries from that feed | |
| #set ($entries = $feed.getChildren()) | |
| <ul> | |
| <li>Feed name: $feed.getName()</li> | |
| <li>Size of Entries array: $entries.size()</li> | |
| <li>Feed namespace URI: $contentRoot.namespace.URI</li> | |
| </ul> | |
| <div class="contentBox from-format"> | |
| #if($entries.size() >= 1) | |
| <ul> | |
| #foreach ($item in $entries) | |
| #if($item.getName() == "entry") | |
| #set ($title = $item.getChild("title").text) | |
| <li> | |
| $_SerializerTool.serialize($title, true) | |
| </li> | |
| #end | |
| #end | |
| </ul> | |
| #end | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment