Advertisement
rg443

Checkpoint Firewall VPN Communities to HTML

Jun 23rd, 2014
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.09 KB | None | 0 0
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  2.     <xsl:output method="xml"/>
  3.  
  4. <!--
  5. <xsl:key name="x1" match="communities/communitie/participant_gateways/participant_gateways/Name" use="."/> 
  6. <xsl:key name="x2" match="communities/communitie/satellite_gateways/satellite_gateways/Name" use="."/> 
  7. -->
  8.  
  9. <xsl:key name="x" match="communities/communitie/participant_gateways/participant_gateways/Name | communities/communitie/satellite_gateways/satellite_gateways/Name" use="."/>
  10.  
  11. <xsl:variable name="no" select="document('xml/network_objects.xml')/network_objects"/>
  12. <xsl:variable name="tmp" />
  13. <xsl:variable name="foo" />  
  14. <xsl:variable name="fo2" />
  15.  
  16. <xsl:template match="/communities">
  17. <style>tr {vertical-align:baseline;}</style>
  18. <table cell_padding="3" style="font:menu;border-collapse:collapse;border:1px solid grey;" rules="rows" border="1">
  19. <xsl:for-each select="communitie">
  20. <xsl:sort data-type="number" select="ID"/>
  21. <tr>
  22. <td><xsl:value-of select="ID"/></td>
  23. <td><xsl:value-of select="Name"/></td>
  24.  
  25. <!-- <td><xsl:value-of select="Class_Name"/></td> -->
  26. <td><xsl:value-of select="concat(Class_Name,', ',default_mep_rule/Class_Name,', ',topology)"/></td>
  27. <td><small><xsl:value-of select="comments"/></small></td>
  28.  
  29.  
  30.  
  31. <td>
  32. <ol>
  33. <xsl:for-each select="participant_gateways/participant_gateways">
  34. <xsl:sort case-order="upper-first" select="Name"/>
  35. <li><xsl:value-of select="Name"/></li>
  36. </xsl:for-each>
  37. </ol>
  38. </td>
  39.  
  40. <td>
  41. <ol>
  42. <xsl:for-each select="satellite_gateways/satellite_gateways">
  43. <xsl:sort case-order="upper-first" select="Name"/>
  44. <li><xsl:value-of select="Name"/></li>
  45. </xsl:for-each>
  46. </ol>
  47. </td>
  48.  
  49. <td>
  50. <ol>
  51. <xsl:for-each select="exclude_srv/exclude_srv">
  52. <xsl:sort case-order="upper-first" select="Name"/>
  53. <li><xsl:value-of select="Name"/></li>
  54. </xsl:for-each>
  55. </ol>
  56. </td>
  57.  
  58. <td>
  59. <small>
  60. <xsl:value-of select="concat('phase1: ',ike_p1/ike_p1_dh_grp/Name,', ',ike_p1/ike_p1_enc_alg,', ',ike_p1/ike_p1_hash_alg,', ',ike_p1/ike_p1_use_aggressive,', ',ike_p1/ike_p1_use_shared_secret,', ',ike_p1/ike_p1_rekey_time) "/>
  61.  
  62. <br/>
  63. <xsl:value-of select="concat('phase2: ',ike_p2/ike_p2_pfs_dh_grp/Name,', ',ike_p2/ike_p2_enc_alg,', ',ike_p2/ike_p2_hash_alg,', ',ike_p2/ike_p2_ipcomp,', ',ike_p2/ike_p2_pfs_dh_grp,', ',ike_p2/ike_p2_rekey_kbytes,', ',ike_p2/ike_p2_rekey_time) "/>
  64. </small>
  65.  
  66.  
  67. </td>
  68.  
  69. </tr>
  70.  
  71. </xsl:for-each>
  72. </table>
  73.  
  74. <ol style="font:menu">
  75. <xsl:for-each select="communitie/participant_gateways/participant_gateways/Name | communitie/satellite_gateways/satellite_gateways/Name">
  76.  
  77. <xsl:sort case-order="upper-first" select="."/>
  78. <xsl:if test="generate-id(.) = generate-id(key('x', .)[1])">
  79. <li>
  80. <xsl:value-of select="."/>
  81. <xsl:text> (</xsl:text>
  82. <xsl:value-of select="count(key('x', .))"/>
  83. <xsl:text>)</xsl:text>
  84. </li>
  85. </xsl:if>
  86.  
  87. </xsl:for-each>
  88. </ol>
  89.  
  90. <table style="font:menu">
  91. <xsl:for-each select="$no/network_object[Class_Name='cluster_member' or Class_Name='gateway_cluster' or Class_Name='gateway_ckp' or Class_Name='gateway_plain' or Class_Name='sofaware_gateway']">
  92. <xsl:sort case-order="upper-first" select="Name"/>
  93. <xsl:variable name="tmp" select="manual_encdomain/Name/text()"/>
  94. <xsl:variable name="foo" select="$no/network_object[Name = $tmp]"/>
  95. <tr>
  96. <td><xsl:number value="position()" format="1" /></td>
  97. <td><xsl:value-of select="Name"/></td>
  98. <td><xsl:value-of select="Class_Name"/></td>
  99. <td><xsl:value-of select="concat(ipaddr,'')"/></td>
  100. <td><xsl:value-of select="manual_encdomain/Name"/></td>
  101. <!-- <td><xsl:value-of select="$no/network_object[Class_Name='network' and Name = $tmp ]"/></td> -->
  102. <td bgcolor="#efefef">
  103.  
  104. <xsl:choose>
  105. <xsl:when test="$foo/Class_Name = 'network'">
  106.    <xsl:value-of select="concat($foo/Name,', ', $foo/Class_Name,': ')"/>
  107.    <xsl:value-of select="concat($foo/ipaddr, ' / ', $foo/netmask)"/>
  108. </xsl:when>
  109. <xsl:when test="$foo/Class_Name = 'host_plain'">
  110.    <xsl:value-of select="concat($foo/Name,', ', $foo/Class_Name,': ')"/> <br/>
  111.    <xsl:value-of select="concat($foo/ipaddr,'/32')"/>
  112. </xsl:when>
  113.  
  114. <xsl:when test="$foo/Class_Name = 'network_object_group' or $foo/Class_Name = 'group_with_exception'">
  115.    <xsl:value-of select="concat($foo/Name,', ', $foo/Class_Name,' ')"/> <br/>
  116.  
  117. </xsl:when>
  118.  
  119.    
  120.  
  121. <xsl:otherwise></xsl:otherwise>
  122. </xsl:choose>
  123. </td>
  124.  
  125. <td>
  126. <xsl:for-each select="interfaces/interfaces">
  127. <xsl:value-of select="concat(Class_Name,' ',ifindex,', ',officialname,', ',ipaddr,': ',member_network/ipaddr,' / ',member_network/netmask,', ',security/netaccess/perform_anti_spoofing,', ',security/netaccess/allowed/Name)"/> <br/>
  128.  
  129.  </xsl:for-each>
  130. </td>
  131.  
  132. </tr>
  133. </xsl:for-each>
  134. </table>
  135. <![CDATA[ ]]>
  136. <div style="font:menu;margin-top:100px;border-top:1px solid dimgray;color:dimgray;">Copyright (c) 2011 Reinhard Gruber, Ing. - Advanceded Stylesheets for <a target="_blank" style="text-decoration:underline;color:dimgray;" href="http://www.google.at/search?q=sk30765">Checkpoint Web Visualization Tool (sk30765)</a>.</div>
  137. </xsl:template>
  138.  
  139. <!--  ..\Xalan.exe -o 2.html xml\communities.xml communities.xsl
  140. 'cluster_member|gateway_ckp|gateway_plain|gateway_cluster'
  141. -->
  142. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement