<?xml version="1.0"?>
<!--
  ~ Copyright (C) 2012 ARIN
  -->

<xsl:stylesheet
        xmlns:whois="http://www.arin.net/whoisrws/core/v1"
        xmlns:netrefv2="http://www.arin.net/whoisrws/netref/v2"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <xsl:template match="/">
    <p><table><xsl:apply-templates/></table></p>
    </xsl:template>

    <xsl:variable name="this">${whoisrws-servlet.baseurl}?</xsl:variable>

    <xsl:template match="whois:pocs" priority="2" >
    <tr><th colspan="2">Points of Contact</th></tr>
    <xsl:apply-templates select="whois:pocRef" />
    </xsl:template>

    <xsl:template match="whois:pocRef" priority="2" >
    <tr><td colspan="2">
        <xsl:value-of select="@name"/>
        (<a href="{.}"><xsl:value-of select="@handle"/>
        </a>)
    </td></tr>
    </xsl:template>

    <xsl:template match="whois:orgs" priority="2" >
    <tr><th colspan="2">Organizations</th></tr>
        <xsl:apply-templates select="whois:orgRef" />
    </xsl:template>

    <xsl:template match="whois:orgRef" priority="2" >
        <tr><td colspan="2">
        <xsl:value-of select="@name"/>
        (<a href="{.}"><xsl:value-of select="@handle"/></a>)
        </td></tr>
    </xsl:template>
    
    <xsl:template match="whois:customers" priority="2" >
    <tr><th colspan="2">Customers</th></tr>
        <xsl:apply-templates select="whois:customerRef" />
    </xsl:template>

    <xsl:template match="whois:customerRef" priority="2" >
        <tr><td colspan="2">
        <xsl:value-of select="@name"/>
        (<a href="{.}"><xsl:value-of select="@handle"/>
        </a>)
        </td></tr>
    </xsl:template>

    <xsl:template match="whois:asns" priority="2" >
    <tr><th colspan="2">Autonomous System Numbers</th></tr>
        <xsl:apply-templates select="whois:asnRef" />
    </xsl:template>

    <xsl:template match="whois:asnRef" priority="2" >
        <tr><td colspan="2">
        <xsl:value-of select="@name"/>
        (<a href="{.}"><xsl:value-of select="@handle"/>
        </a>)
        </td></tr>
    </xsl:template>

    <xsl:template match="whois:nets" priority="2" >
    <tr><th colspan="2">Networks</th></tr>
        <xsl:apply-templates select="whois:netRef" />
        <xsl:apply-templates select="netrefv2:netRef" />
        <xsl:apply-templates select="whois:net" />
    </xsl:template>

    <xsl:template match="whois:netRef" priority="2" >
        <tr><td>
        <xsl:value-of select="@name"/>
        (<a href="{.}"><xsl:value-of select="@handle"/></a>)
        </td><td><xsl:value-of select="@startAddress"/> - <xsl:value-of select="@endAddress"/></td></tr>
    </xsl:template>

    <xsl:template match="netrefv2:netRef" priority="2" >
        <tr><td>
        <xsl:value-of select="@name"/>
        (<a href="{netrefv2:ref}"><xsl:value-of select="@handle"/></a>)
            </td>
            <td>
        <xsl:value-of select="@startAddress"/> - <xsl:value-of select="@endAddress"/>
        </td></tr>
    </xsl:template>

    <xsl:template match="whois:net" priority="2" >
        <tr><td>
        <xsl:value-of select="whois:name"/>
        (<a href="{whois:ref}"><xsl:value-of select="whois:handle"/></a>)
        </td><td><xsl:value-of select="whois:startAddress"/> - <xsl:value-of select="whois:endAddress"/></td></tr>
    </xsl:template>

    <xsl:template match="whois:limitExceeded"/>

</xsl:stylesheet>
