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

-->

<xsl:stylesheet 
    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/"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

   <xsl:output method="xml" encoding="UTF-8" indent="yes"/>

   <xsl:param name="status" select="'all'"/>
   <xsl:param name="exclude" select="''"/>

   <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

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

</xsl:comment>

      <xsl:comment>excludes: <xsl:value-of select="$exclude"/></xsl:comment>

      <ex:messages>
	<xsl:apply-templates select="//ex:example/*" mode="message"/>
      </ex:messages>

   </xsl:template>

    <xsl:template match="ex:instance" mode="message">
	<xsl:variable name="m">:<xsl:value-of select="../@xml:id"/>:</xsl:variable>
	<xsl:variable name="ged">echo<xsl:value-of select="../@xml:id"/></xsl:variable>
      <xsl:if test="not(contains($exclude,$m))">
	<ex:message>
	<xsl:attribute name="xml:id"><xsl:value-of select="./@xml:id"/></xsl:attribute>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header/>
      <env:Body>
	<xsl:element name="{$ged}">
	    <xsl:copy-of select="./*"/>
	</xsl:element>
      </env:Body>
    </env:Envelope>
	</ex:message>
      </xsl:if>
    </xsl:template>

</xsl:stylesheet>
