Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml"/>
- <!--
- <xsl:key name="x1" match="communities/communitie/participant_gateways/participant_gateways/Name" use="."/>
- <xsl:key name="x2" match="communities/communitie/satellite_gateways/satellite_gateways/Name" use="."/>
- -->
- <xsl:key name="x" match="communities/communitie/participant_gateways/participant_gateways/Name | communities/communitie/satellite_gateways/satellite_gateways/Name" use="."/>
- <xsl:variable name="no" select="document('xml/network_objects.xml')/network_objects"/>
- <xsl:variable name="tmp" />
- <xsl:variable name="foo" />
- <xsl:variable name="fo2" />
- <xsl:template match="/communities">
- <style>tr {vertical-align:baseline;}</style>
- <table cell_padding="3" style="font:menu;border-collapse:collapse;border:1px solid grey;" rules="rows" border="1">
- <xsl:for-each select="communitie">
- <xsl:sort data-type="number" select="ID"/>
- <tr>
- <td><xsl:value-of select="ID"/></td>
- <td><xsl:value-of select="Name"/></td>
- <!-- <td><xsl:value-of select="Class_Name"/></td> -->
- <td><xsl:value-of select="concat(Class_Name,', ',default_mep_rule/Class_Name,', ',topology)"/></td>
- <td><small><xsl:value-of select="comments"/></small></td>
- <td>
- <ol>
- <xsl:for-each select="participant_gateways/participant_gateways">
- <xsl:sort case-order="upper-first" select="Name"/>
- <li><xsl:value-of select="Name"/></li>
- </xsl:for-each>
- </ol>
- </td>
- <td>
- <ol>
- <xsl:for-each select="satellite_gateways/satellite_gateways">
- <xsl:sort case-order="upper-first" select="Name"/>
- <li><xsl:value-of select="Name"/></li>
- </xsl:for-each>
- </ol>
- </td>
- <td>
- <ol>
- <xsl:for-each select="exclude_srv/exclude_srv">
- <xsl:sort case-order="upper-first" select="Name"/>
- <li><xsl:value-of select="Name"/></li>
- </xsl:for-each>
- </ol>
- </td>
- <td>
- <small>
- <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) "/>
- <br/>
- <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) "/>
- </small>
- </td>
- </tr>
- </xsl:for-each>
- </table>
- <ol style="font:menu">
- <xsl:for-each select="communitie/participant_gateways/participant_gateways/Name | communitie/satellite_gateways/satellite_gateways/Name">
- <xsl:sort case-order="upper-first" select="."/>
- <xsl:if test="generate-id(.) = generate-id(key('x', .)[1])">
- <li>
- <xsl:value-of select="."/>
- <xsl:text> (</xsl:text>
- <xsl:value-of select="count(key('x', .))"/>
- <xsl:text>)</xsl:text>
- </li>
- </xsl:if>
- </xsl:for-each>
- </ol>
- <table style="font:menu">
- <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']">
- <xsl:sort case-order="upper-first" select="Name"/>
- <xsl:variable name="tmp" select="manual_encdomain/Name/text()"/>
- <xsl:variable name="foo" select="$no/network_object[Name = $tmp]"/>
- <tr>
- <td><xsl:number value="position()" format="1" /></td>
- <td><xsl:value-of select="Name"/></td>
- <td><xsl:value-of select="Class_Name"/></td>
- <td><xsl:value-of select="concat(ipaddr,'')"/></td>
- <td><xsl:value-of select="manual_encdomain/Name"/></td>
- <!-- <td><xsl:value-of select="$no/network_object[Class_Name='network' and Name = $tmp ]"/></td> -->
- <td bgcolor="#efefef">
- <xsl:choose>
- <xsl:when test="$foo/Class_Name = 'network'">
- <xsl:value-of select="concat($foo/Name,', ', $foo/Class_Name,': ')"/>
- <xsl:value-of select="concat($foo/ipaddr, ' / ', $foo/netmask)"/>
- </xsl:when>
- <xsl:when test="$foo/Class_Name = 'host_plain'">
- <xsl:value-of select="concat($foo/Name,', ', $foo/Class_Name,': ')"/> <br/>
- <xsl:value-of select="concat($foo/ipaddr,'/32')"/>
- </xsl:when>
- <xsl:when test="$foo/Class_Name = 'network_object_group' or $foo/Class_Name = 'group_with_exception'">
- <xsl:value-of select="concat($foo/Name,', ', $foo/Class_Name,' ')"/> <br/>
- </xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </td>
- <td>
- <xsl:for-each select="interfaces/interfaces">
- <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/>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:for-each>
- </table>
- <![CDATA[ ]]>
- <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>
- </xsl:template>
- <!-- ..\Xalan.exe -o 2.html xml\communities.xml communities.xsl
- 'cluster_member|gateway_ckp|gateway_plain|gateway_cluster'
- -->
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement