前ステップ
1. Download common-jelly package from: http://redrockdigimark.com/apachemirror/commons/jelly/binaries/commons-jelly-1.0.zip
2. Extract the files from the zip
3. Copy the following files: commons-jelly-tags-util-1.1.1.jar, commons-jelly-tags-xml-1.1.jar, commons-jelly-tags-fmt-1.0.jar
4. Paste the above files at: <Jenkins server path>\war\WEB-INF\lib
5. Restart Jenkins
:ファイルは{myxmldoc}に読み出されると、それは、必要な属性および要素を介して照会またはループするために、標準的なXPATH表現と共に使用することができるDOM4J文書なりますXMLは次のとおりです。
<sites>
<site>
<URL>http://www.google.com</URL>
<STATUS>200</STATUS>
</site>
<site>
<URL>http://www.yahoo.com</URL>
<STATUS>200</STATUS>
</site>
</sites>
ゼリーコードにabc.xml上記のXMLを読む
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:x="jelly:xml" xmlns:html="jelly:html" xmlns:util="jelly:util">
<j:set var="xmlFilePath" value="${build.getWorkspace().child('abc.xml')}"/>
<util:file name="${xmlFilePath}" var="xmlFileContent" />
<x:parse var="myxmldoc" xml="${xmlFileContent}"/>
<x:set var="allSites" select="$myxmldoc/sites"/>
<table class="border">
<tr>
<th class="border1"><b>URL</b></th>
<th class="border1" width="140px"><b>HTTP Code</b></th>
<th class="border1" width="140px"><b>Status</b></th>
</tr>
<x:forEach var="mysite" select="$allSites/site">
<j:set var="myURL"><x:expr select='$mysite/URL' /></j:set>
<j:set var="myStatus"><x:expr select='$mysite/STATUS' /></j:set>
<tr>
<td class="border_test_passed">
<a href="${myURL}">${myURL}</a>
</td>
<td class="border_test_total">
<b>${myStatus}</b>
</td>
<td class="border_test_total">
<j:choose>
<j:when test="${myStatus=='200'}"><img src="${rooturl}userContent/BSGreen.png" width="15px" /></j:when>
<j:otherwise><img src="${rooturl}userContent/BSRed.png" width="15px" /></j:otherwise>
</j:choose>
</td>
</tr>
</x:forEach>
</table>