<?xml version="1.0" encoding="utf-8"?>
<!-- 

    Copyright (C) 2006 W3C (R) (MIT ERCIM Keio), All Rights Reserved.
    W3C liability, trademark and document use rules apply.

    http://www.w3.org/Consortium/Legal/ipr-notice
    http://www.w3.org/Consortium/Legal/copyright-documents

    $Header: /w3ccvs/WWW/2002/ws/databinding/edcopy/patterns/detected.xsl,v 1.4 2006/11/06 15:36:31 pdowney Exp $

-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:p="http://www.w3.org/2002/ws/databinding/patterns/6/09/"
    xmlns:ex="http://www.w3.org/2002/ws/databinding/examples/6/09/"
    exclude-result-prefixes="">

    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
    
    <xsl:variable name="w3c.root">http:/www.w3.org/</xsl:variable>
    <xsl:param name="patternsDir">http://www.w3.org/2002/ws/databinding/patterns/6/09/</xsl:param>
    
    <xsl:template match="/">
	<xsl:variable name="detectedStatus"><xsl:value-of select="detected/@status"/></xsl:variable>

	<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
	  <head>
	    <link type="text/css" rel="stylesheet" href="{$w3c.root}/StyleSheets/TR/base.css"/>
<style type="text/css">
div.exampleInner pre { margin-left: 1em;
                       margin-top: 0em; margin-bottom: 0em}
div.exampleInner { background-color: #d5dee3;
                   border-top-width: 4px;
                   border-top-style: double;
                   border-top-color: #d3d3d3;
                   border-bottom-width: 4px;
                   border-bottom-style: double;
                   border-bottom-color: #d3d3d3;
                   padding: 4px; margin: 0em }

table { empty-cells: show; }

th { color: #000000; background-color: #CCCC99; }

td { vertical-align: top; }

table caption {
	font-weight: normal;
	font-style: italic;
	text-align: left;
	margin-bottom: .5em;
}
</style>
  </head>

  <body xmlns:rddl="http://www.rddl.org/">

            <xsl:comment>

                Copyright (C) 2006 W3C (R) (MIT ERCIM Keio), All Rights Reserved.
                W3C liability, trademark and document use rules apply.
            
                http://www.w3.org/Consortium/Legal/ipr-notice
                http://www.w3.org/Consortium/Legal/copyright-documents
            
                &#x24;Header$

            </xsl:comment>

    <div class="head">
      <p>

	<a href="http://www.w3.org/">
	  <img width="72" height="48" alt="W3C" src="{$w3c.root}/Icons/w3c_home"/>
	</a>
      </p>
    </div>

	<p id="detectedPatterns">The submitted document has been classified as being 

		<xsl:choose>
		    <xsl:when test="$detectedStatus = 'basic'">
			possibly a <a href="{$w3c.root}/2002/ws/databinding/edcopy/basic/basic.html">Basic XML Schema Patterns for Databinding 1.0</a>
			<xsl:text> </xsl:text> 
			<a href="{$w3c.root}/2002/ws/databinding/edcopy/advanced/advanced.html#document-conformance">conformant document</a>
			as it only 
		    </xsl:when>
		    <xsl:when test="$detectedStatus = 'advanced'" xml:space='preserve'>
			possibly an <a href="{$w3c.root}/2002/ws/databinding/edcopy/advanced/advanced.html">Advanced XML Schema Patterns for Databinding 1.0</a>
			<xsl:text> </xsl:text> 
			<a href="{$w3c.root}/2002/ws/databinding/edcopy/advanced/advanced.html#document-conformance">conformant document</a>
			as it only 
		    </xsl:when>
		    <xsl:otherwise>
			"<xsl:value-of select="$detectedStatus"/>"
			as it
		    </xsl:otherwise>
		</xsl:choose>

	    exhibits the following <a href="{$patternsDir}">patterns</a>:</p>

	<table border="1">
	<tr>
	    <th>Status</th>
	    <th>Name</th>
	    <th>XPath</th>
	</tr>
	
	<xsl:for-each select="detected/pattern">
	    <tr>
		<td>
		<xsl:choose>
		    <xsl:when test="@status = 'basic' or @status = 'advanced'">
			<a href="{$w3c.root}/2002/ws/databinding/edcopy/{@status}/{@status}.html#pattern-{@name}"><xsl:value-of select="@status"/></a>
		    </xsl:when>
		    <xsl:otherwise>
			<xsl:value-of select="@status"/>
		    </xsl:otherwise>
		</xsl:choose>
		</td>
		<td><a href="{@pattern}"><xsl:value-of select="@name"/></a></td>
		<td>
		    <xsl:value-of select="@xpath"/>
		</td>
	    </tr>
	</xsl:for-each>

	</table>
  </body>
</html>
    </xsl:template>

</xsl:stylesheet>
