<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output indent="yes" />

<!--mantengo las variables globales-->
   <xsl:variable name="orientationpt" select="'PtoT'" />

   <xsl:variable name="orientationtp" select="'TtoP'" />

   <xsl:variable name="x" select="'0'" />

   <xsl:variable name="y" select="1" />

   <xsl:template match="/">
      <workspaceElements>
         <generator tool="CPN Tools" version="2.9.12" format="6" />

<cpnet>
<xsl:for-each select="//declaration/child::*">
	<xsl:copy-of select="."/>
</xsl:for-each>	
<page id="ID6">

<pageattr name="Petri's Net"/>

	<xsl:for-each select="//place">
		<place>
 		
 			<xsl:attribute name="id"><xsl:value-of select="concat('ID',count(preceding::*))"/></xsl:attribute>  		
  			
	  		<posattr x="-107.000000"
                 y="-99.000000"/>
        <fillattr colour="White"
                  pattern=""
                  filled="false"/>
        <lineattr colour="Black"
                  thick="1"
                  type="Solid"/>
        <textattr colour="Black"
                  bold="false"/>
	 			<xsl:copy-of select="text"/>
	 			
	 		<ellipse w="60.000000" h="40.000000"/>
		<token x="-10.000000" y="0.000000"/>
		<marking x="0.000000" y="0.000000" hidden="false">
		<snap snap_id="0"
		anchor.horizontal="0"
		anchor.vertical="0"/>
		</marking>
	 		<type>
	 			<xsl:attribute name="id"><xsl:value-of select="type/@id"/></xsl:attribute>
	 			<posattr x="-45.000000" y="-122.000000"/>
	 			
	 		<fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
	 		<xsl:copy-of select="type/text"/>
			</type>
			<initmark>
			<xsl:attribute name="id"><xsl:value-of select="initmark/@id"/></xsl:attribute>  		
	  		
		  <posattr x="-395.500000"
                   y="-2.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>

	  		<xsl:copy-of select="initmark/text"/>
	  		</initmark>
	  		
		</place>
	</xsl:for-each>	
	
		
	<xsl:for-each select="//trans">
		<trans>
  		<xsl:attribute name="id"><xsl:value-of select="concat('ID',count(preceding::*))"/></xsl:attribute>  
  		<xsl:attribute name="explicit"><xsl:value-of select="'false'"/></xsl:attribute>
  		<posattr x="-199.000000"
                 y="141.000000"/>
        <fillattr colour="White"
                  pattern=""
                  filled="false"/>
        <lineattr colour="Black"
                  thick="1"
                  type="solid"/>
        <textattr colour="Black"
                  bold="false"/>
  		<xsl:copy-of select="text"/>
  		<xsl:copy-of select="box"/>
  		<xsl:copy-of select="binding"/>
  		<cond>
  		<xsl:attribute name="id"><xsl:value-of select="cond/@id"/></xsl:attribute>
  		<posattr x="-254.000000"
                   y="172.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
  		<xsl:copy-of select="cond/text"/>
  		</cond>
  		<time>
  		<xsl:attribute name="id"><xsl:value-of select="time/@id"/></xsl:attribute>  
  		<posattr x="-120.500000"
                   y="175.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
  		<xsl:copy-of select="time/text"/>
  		</time>
  		<code>
  		<xsl:attribute name="id"><xsl:value-of select="code/@id"/></xsl:attribute>  
  		<posattr x="-134.500000"
                   y="89.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
  		<xsl:copy-of select="code/text"/>
  		</code>
  		<channel>
  		<xsl:attribute name="id"><xsl:value-of select="channel/@id"/></xsl:attribute>  
  		<posattr x="-262.500000"
                   y="141.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
  		<xsl:copy-of select="channel/text"/>
  		</channel>
  		<priority>
  		<xsl:attribute name="id"><xsl:value-of select="priority/@id"/></xsl:attribute>  
  		<posattr x="-270.000000"
                   y="100.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
  		<xsl:copy-of select="priority/text"/>
  		</priority>
  		</trans>
	</xsl:for-each>	
	
 <xsl:for-each select="//place">
 		<xsl:variable name="place" select="@id"/>
 		<xsl:variable name="idenplace" select="concat('ID',count(preceding::*))"/>
 		<xsl:for-each select="//trans">
 			<xsl:variable name="trans" select="@id"/>
 				<xsl:variable name="identrans" select="concat('ID',count(preceding::*))"/>
		<xsl:for-each select="//arc">
		
			<xsl:if test="($place=placeend/@idref) and ($trans=transend/@idref)">
				<arc>
	<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>  	
	<xsl:attribute name="orientation"><xsl:value-of select="@orientation"/></xsl:attribute>  
	<xsl:attribute name="order"><xsl:value-of select="1"/></xsl:attribute>
		<posattr x="0.000000"
                   y="0.000000"/>
          <fillattr colour="White"
                    pattern=""
                    filled="false"/>
          <lineattr colour="Black"
                    thick="1"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
          <arrowattr headsize="1.200000"
          			 currentcyckle="2"/>	          
	
	<xsl:if test="contains(@orientation,'PtoT')">
		<xsl:element name="placeend">
		<xsl:attribute name="idref">
		<xsl:value-of select="$idenplace"/></xsl:attribute>
		</xsl:element>
		<xsl:element name="transend">
		<xsl:attribute name="idref">
		<xsl:value-of select="$identrans"/></xsl:attribute>
		</xsl:element>
	</xsl:if>
	<xsl:if test="contains(@orientation,'TtoP')">
		<xsl:element name="transend">
		<xsl:attribute name="idref">
		<xsl:value-of select="$identrans"/></xsl:attribute>
		</xsl:element>
		<xsl:element name="placeend">
		<xsl:attribute name="idref">
		<xsl:value-of select="$idenplace"/></xsl:attribute>
		</xsl:element>
	</xsl:if>
	<annot>
		<xsl:attribute name="id"><xsl:value-of select="annot/@id"/></xsl:attribute>
		<posattr x="-87.000000"
                   y="-141.000000"/>
          <fillattr colour="White"
                    pattern="Solid"
                    filled="false"/>
          <lineattr colour="Black"
                    thick="0"
                    type="Solid"/>
          <textattr colour="Black"
                    bold="false"/>
                 
          <xsl:copy-of select="annot/text"/>
			
	</annot>
	</arc>
				
			</xsl:if>
			
		</xsl:for-each>	
		</xsl:for-each>
	</xsl:for-each>
	
 
 
</page> 
<xsl:for-each select="//fin/child::*">
	<xsl:copy-of select="."/>
</xsl:for-each> 

</cpnet>
</workspaceElements>
</xsl:template>



</xsl:stylesheet>
