<?xml version="1.0"?>
<!-- 

    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/validate.xsl,v 1.5 2007/04/19 11:17:25 pdowney Exp $

-->
<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ex="http://www.w3.org/2002/ws/databinding/examples/6/09/">

    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">
<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

    <xsl:value-of select="ex:version"/>

</xsl:comment>
        <project name="validate" default="init">
            <target name="init">
		<xsl:apply-templates select="//ex:instance"/>
            </target>
        </project>
    </xsl:template>

    <xsl:template match="ex:instance">
	<xsl:variable name="examplesDir">../../examples/6/09</xsl:variable>
	<xsl:variable name="example" select="../@xml:id"/>
	<xsl:variable name="instance" select="./@xml:id"/>

    <echo><xsl:value-of select="$instance"/></echo>
    <xmlvalidate file="{$examplesDir}/{$example}/{$example}-{$instance}.xml" 
	lenient="false" failonerror="false" warn="true">

	<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
	<attribute name="http://xml.org/sax/features/validation" value="true"/>
	<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
	<attribute name="http://apache.org/xml/features/validation/schema-full-checking" value="true"/>

	<property 
	    name="http://apache.org/xml/properties/schema/external-schemaLocation"
	    value="http://www.w3.org/2002/ws/databinding/examples/6/09/ file:{$examplesDir}/{$example}/{$example}.xsd"/>

    </xmlvalidate>
    </xsl:template>

</xsl:stylesheet>
