<?xml version="1.0"?><!-- Authors: Jan Mendling, Alberto BrabenetzTitle: Transformation of EPML to Scalable Vector Graphics (SVG) Copyright: Jan Mendling, Alberto Brabenetz--><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect" xmlns:java="http://xml.apache.org/xslt/java" extension-element-prefixes="redirect"  xmlns:xlink="http://www.w3.org/1999/xlink"><xsl:output method="xml" doctype-public="-//W3C//DTD SVG 20001102//EN" doctype-system="http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg10.dtd"/>    <!-- Scaling factor for zoom -->        <xsl:variable name="Scaling" select="0.4"/>    <!-- Colors for epc elements -->        <xsl:variable name="CLevent">#FF00FF</xsl:variable>        <xsl:variable name="CLfunkt">#00FF00</xsl:variable>        <xsl:variable name="CLproif">none</xsl:variable>        <xsl:variable name="CLconector">none</xsl:variable>        <xsl:variable name="CLTag">black</xsl:variable>    <!-- number of EPC process models -->        <xsl:variable name="NoEPCs">            <xsl:value-of select="count(//epc)"/>        </xsl:variable>        <!-- Generate HTML Files:         x_frame.html        for the definition of the frameset        oben.html           for the header frame        x_home.html         to be displayed in the center frame as a default        links.html          to display a navigation list in the left frame          epcId{$epcId}.html  for each epc element in the EPML file        -->    <xsl:template match="/">    <!-- x_frame.html for the definition of the frameset -->        <redirect:write file="x_frame.html">            <html>                <head>                <!-- metadata according to Dublin Core-->                <meta name="DC.Title" content="EPML2SVG - Main Frame Page "/>                <meta name="DC.Creator" content="Jan Mendling"/>                <meta name="DC.Creator" content="Alberto Brabenetz"/>                <meta name="DC.Description" content="Transformation of EPML to Scalable Vector Graphics (SVG) "/>                <meta name="DC.Language" content="en"/>                <meta name="DC.Date" content="2004-09-01"/>                <meta name="DC.Coverage" content="Vienna"/>                <meta name="DC.Rights" content="All right remain with the Authors"/>                <title>EPML2SVG</title>                <!-- frame definition -->                <frameset rows="10%,*">                <frame src="oben.html" name="kopf" scrolling="no"/>                <frameset cols="20%,*"/>                <frame src="links.html" name="menue"/>                <frame src="x_home.html" name="view_svg" scrolling="yes"/>                </frameset>                <noframes> Your browser does not support frame, unfortunately.</noframes></head>                    <body>                </body>            </html>        </redirect:write>    <!-- oben.html for the header frame -->        <xsl:variable name="date" select="java:java.util.Date.new()"/>        <redirect:write file="oben.html">            <html>                <head>                    <title>Header EPML2SVG</title>                </head>                <body bgcolor="#EEEEF0" text="#003192">                 <span style="font-family:'Helvetica';font-size:14pt;font-weight:300;text-indent:12pt"> EPC Business Process Repository generated by </span>                <span style="font-family:'Helvetica';font-size:14pt;font-weight:300;color:#AA0078">EPML2SVG</span>                <span style="font-family:'Helvetica';font-size:14pt;color:#EEEEF0">. . . . </span>                <span style="font-family:'Helvetica';font-size:10pt"><i> developed by Jan Mendling and Alberto Brabenetz 2004 - </i></span><br/>                <div style="position:absolute; bottom:1pt">                <span style="font-family:'Helvetica';font-size:10pt;text-indent:12pt" align="right">(last transformation: <b><xsl:value-of select="$date"/>                </b>)</span></div>                </body>            </html>        </redirect:write>    <!--    x_home.html to be displayed in the center frame as a default -->        <redirect:write file="x_home.html">            <html>                <head>                    <title>View your EPML business process models</title>                </head>                <body bgcolor="#EEEEF0" text="#003192"><p/><center>                <span style="font-family:'Helvetica';font-size:14pt;color:#FAFADC">. . . . </span><p/>                <span style="font-family:'Helvetica';font-size:18pt;font-weight:300;color:#AA0078">                Transformation from EPML to Scalable Vector Graphics (SVG) </span><p/>                <table border="0">                <tr><td> - <span style="font-family:'Helvetica';font-size:12pt">                Choose a link in the navigation frame (left) to see the respective EPC business process model</span><p/></td></tr>                <tr><td> - <span style="font-family:'Helvetica';font-size:12pt">                The website repository has been generated at: <b><xsl:value-of select="$date"/></b></span><p/></td></tr>                </table></center>                </body>            </html>        </redirect:write>    <!-- links.html to display a navigation list in the left frame -->        <redirect:write file="links.html">            <html>                <head>                    <title>menu bar - left frame</title>                </head>                <body bgcolor="#EEEEF0" text="#003192">                <b><center><span style="font-family:'Helvetica';font-size:14pt;font-weight:300">EPC model list</span>                </center></b><p/>                <ul>                <li><a href="x_home.html" target="view_svg">Home</a></li><p/>                <!-- generate linklist -->                    <xsl:for-each select=".//*[@epcId]">                        <xsl:variable name="svglink"><xsl:text>epcId</xsl:text><xsl:value-of select="@epcId"/><xsl:text>.html</xsl:text>                    </xsl:variable>                    <li><a href="{$svglink}" target="view_svg"><xsl:value-of select="@name"/>(Id=<xsl:value-of select="@epcId"/>)</a></li>                </xsl:for-each>                </ul>                <p/><div style="position:absolute; bottom:4pt"><hr/>                <img src="../nmlogo.gif" alt="NM_Logo" align="bottom"/></div>                </body>            </html>        </redirect:write>    <!--    triggering transformation for each epc element -->        <xsl:choose>            <xsl:when test="($NoEPCs) > = 1">                <xsl:apply-templates select="//epc"/>            </xsl:when>            <xsl:otherwise>                <xsl:if test="($NoEPCs)&lt;1">                    <xsl:message terminate="yes">                     SORRY - the EPML source file contains no epc elements.                     </xsl:message>                </xsl:if>            </xsl:otherwise>        </xsl:choose>    </xsl:template><!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Generation of a HTML file displaying an SVG graphic of the EPC business process model for each epc element+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="//epc">        <xsl:choose>            <xsl:when test="element-available('redirect:write')">                <xsl:variable name="SVG_filename">                    <xsl:text>epcId</xsl:text>                    <xsl:value-of select="@epcId"/>                    <xsl:text>.svg</xsl:text>                </xsl:variable>                <redirect:write select="$SVG_filename">                    <xsl:call-template name="epc-html"/>                </redirect:write>            </xsl:when>            <!--xsl:otherwise>    </xsl:otherwise-->        </xsl:choose>    </xsl:template>    <!-- generate html and svg file for each epc element -->    <xsl:template name="epc-html">        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        calculate maximum coordinates        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->        <xsl:variable name="Ymax">            <xsl:choose>                <xsl:when test=".//*[@y]">                    <xsl:for-each select=".//*[@y]">                        <xsl:sort select="number(@y)+number(@height)" data-type="number" order="descending"/>                        <xsl:if test="position()=1">                            <xsl:value-of select="$Scaling*(number(@y)+number(@height))"/>                        </xsl:if>                    </xsl:for-each>                </xsl:when>                <xsl:otherwise>                    <xsl:value-of select="1"/>                </xsl:otherwise>            </xsl:choose>        </xsl:variable>        <xsl:variable name="Xmax">            <xsl:choose>                <xsl:when test=".//*[@x]">                    <xsl:for-each select=".//*[@x]">                        <xsl:sort select="number(@x)+number(@width)" data-type="number" order="descending"/>                        <xsl:if test="position()=1">                            <xsl:value-of select="$Scaling*(number(@x)+number(@width))"/>                        </xsl:if>                    </xsl:for-each>                </xsl:when>                <xsl:otherwise>                    <xsl:value-of select="1"/>                </xsl:otherwise>            </xsl:choose>        </xsl:variable>        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        generate html file to include svg graphic        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->        <xsl:variable name="right_filename">            <xsl:text>epcId</xsl:text>            <xsl:value-of select="@epcId"/>            <xsl:text>.html</xsl:text>        </xsl:variable>        <xsl:variable name="SVG_filename">            <xsl:text>epcId</xsl:text>            <xsl:value-of select="@epcId"/>            <xsl:text>.svg</xsl:text>        </xsl:variable>        <redirect:write select="$right_filename">            <html>                <head>                    <title>HTML file referencing the respective SVG process model</title>                    <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++                     This script is taken from Marco Assmann's website                      http://www-user.tu-chemnitz.de/~maas/projectpage/js.php                     +++++++++++++++++++++++++++++++++++++++++++++++++++++-->                    <script src="svg_func_in_html.js" type="text/javascript">_                    </script>                </head>                <body>                    <p>                         <b>EPC name: <xsl:value-of select="@name"/></b><br/>                        <b>Xmax: <xsl:value-of select="$Xmax"/></b><br/>                        <b>Ymax: <xsl:value-of select="$Ymax"/></b><br/>                    </p>                    <EMBED TYPE="image/svg" name="SVG_map" src="{$SVG_filename}" width="{$Xmax}" height="{$Ymax}" border="1">                    </EMBED>                </body>            </html>        </redirect:write>        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        generate svg file for an epc element        +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->        <svg width="{$Xmax}" height="{$Ymax}">            <marker id="arrow" refX="10" refY="5" markerUnits="strokeWidth" markerWidth="10" markerHeight="10" orient="auto">                <path fill="black" d="M 0 0 10 5 0 10 z"/>            </marker>            <xsl:apply-templates select="event"/>            <xsl:apply-templates select="function"/>            <xsl:apply-templates select="processInterface"/>            <xsl:apply-templates select="arc"/>            <xsl:apply-templates select="xor"/>            <xsl:apply-templates select="or"/>            <xsl:apply-templates select="and"/>        </svg>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    event template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="event"> 'my position info event'        <xsl:variable name="twidth">            <xsl:value-of select="graphics/position/@width"/>        </xsl:variable>        <xsl:variable name="theight">            <xsl:value-of select="graphics/position/@height"/>        </xsl:variable>        <xsl:variable name="tx">            <xsl:value-of select="graphics/position/@x"/>        </xsl:variable>        <xsl:variable name="tx1">            <xsl:value-of select="$tx+$twidth*0.15"/>        </xsl:variable>        <xsl:variable name="tx2">            <xsl:value-of select="$tx+$twidth*0.85"/>        </xsl:variable>        <xsl:variable name="tx3">            <xsl:value-of select="$tx+$twidth"/>        </xsl:variable>        <xsl:variable name="ty">            <xsl:value-of select="graphics/position/@y"/>        </xsl:variable>        <xsl:variable name="ty1">            <xsl:value-of select="graphics/position/@y +$theight*0.5"/>        </xsl:variable>        <xsl:variable name="ty2">            <xsl:value-of select="$ty+$theight"/>        </xsl:variable>        <!-- draw event -->        <g epc="event" id="@id">        <polyline points="{$tx},{$ty1} {$tx1},{$ty} {$tx2},{$ty} {$tx3},{$ty1} {$tx2},{$ty2} {$tx1},{$ty2} {$tx},{$ty1}"             stroke="black"             fill="{$CLevent}"             stroke-width="2"             transform="scale({$Scaling})"/>        <text x="{$tx1 +10}"             y="{$ty +16}"             font-size="10pt"             fill="green"             transform="scale({$Scaling})">                Event ID: <xsl:value-of select="@id"/> - <tspan font-size="7pt">                Characters:<xsl:value-of select="string-length(name)"/>            </tspan>        </text>        <xsl:variable name="yMitte"><xsl:value-of select="graphics/position/@height*0.5"/></xsl:variable>        <xsl:variable name="xeinzug"><xsl:value-of select="graphics/position/@width*0.2"/></xsl:variable>        <xsl:call-template name="Text">            <xsl:with-param name="Text" select="name"/>            <xsl:with-param name="x" select="$tx"/>            <xsl:with-param name="y" select="$ty"/>            <xsl:with-param name="yMitte" select="$yMitte"/>            <xsl:with-param name="xeinzug" select="$xeinzug"/>        </xsl:call-template>        </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    function template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="function"> 'my position info function'    <g epc="function"  id="@id">        <rect x="{graphics/position/ @x}"             y="{graphics/position/ @y}"             rx="20"             ry="20"             width="{graphics/position/ @width}"             height="{graphics/position/ @height}"             stroke-width="2"             stroke="black"             fill="{$CLfunkt}"             transform="scale({$Scaling})"/>        <!-- if applicable toProcess linkToEpcId="x"-->        <xsl:choose>            <xsl:when test="count(toProcess)>0">                <xsl:variable name="px"><xsl:value-of select="graphics/position/ @width*0.25"/></xsl:variable>                <xsl:variable name="py"><xsl:value-of select="graphics/position/ @height*0.85"/></xsl:variable>                <xsl:variable name="epclink">epcId<xsl:value-of select="toProcess/ @linkToEpcId"/><xsl:text>.html</xsl:text></xsl:variable>                <text x="{graphics/position/ @x + $px}" y="{graphics/position/ @y + $py}"                     font-size="10pt"                     fill="blue"                     transform="scale({$Scaling})">                    <a xlink:href="{$epclink}"                         target="view_svg">Link to process: <xsl:value-of select="toProcess/ @linkToEpcId"/></a>                </text>            </xsl:when>            <xsl:otherwise/>        </xsl:choose>        <text x="{graphics/position/ @x+12}"             y="{graphics/position/ @y+16}"             font-size="10pt"             fill="green"             transform="scale({$Scaling})">Function ID: <xsl:value-of select="@id"/>        </text>        <xsl:variable name="yMitte"><xsl:value-of select="graphics/position/@height*0.5"/></xsl:variable>        <xsl:variable name="xeinzug"><xsl:value-of select="graphics/position/@width*0.2"/></xsl:variable>        <xsl:call-template name="Text">            <xsl:with-param name="Text" select="name"/>            <xsl:with-param name="x" select="graphics/position/@x"/>            <xsl:with-param name="y" select="graphics/position/@y"/>            <xsl:with-param name="yMitte" select="$yMitte"/>            <xsl:with-param name="xeinzug" select="$xeinzug"/>        </xsl:call-template>    </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    process interface template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="processInterface"> 'my position info processInterface'        <xsl:variable name="PIx0"><xsl:value-of select="graphics/position/@x"/></xsl:variable>        <xsl:variable name="PIy0"><xsl:value-of select="graphics/position/@y"/></xsl:variable>        <xsl:variable name="PIwidth"><xsl:value-of select="graphics/position/@width"/></xsl:variable>        <xsl:variable name="PIheight"><xsl:value-of select="graphics/position/@height"/></xsl:variable>        <xsl:variable name="PIx1"><xsl:value-of select="$PIx0 + $PIwidth*0.89"/></xsl:variable>        <xsl:variable name="PIx2"><xsl:value-of select="$PIx0 + $PIwidth"/></xsl:variable>        <xsl:variable name="PIx3"><xsl:value-of select="$PIx0 + $PIwidth*0.85"/></xsl:variable>        <xsl:variable name="PIx4"><xsl:value-of select="$PIx0 + $PIwidth*0.2"/></xsl:variable>        <xsl:variable name="PIx5"><xsl:value-of select="$PIx0 + $PIwidth*0.1"/></xsl:variable>        <xsl:variable name="PIy1"><xsl:value-of select="$PIy0 +$PIheight*0.2"/></xsl:variable>        <xsl:variable name="PIy2"><xsl:value-of select="$PIy0 +$PIheight*0.62"/></xsl:variable>        <xsl:variable name="PIy3"><xsl:value-of select="$PIy0 + $PIheight"/></xsl:variable>        <xsl:variable name="PIy4"><xsl:value-of select="$PIy0 + $PIheight*0.9"/></xsl:variable>    <g epc="processInterface" id="@id">        <rect x="{$PIx0}"             y="{$PIy0}"             rx="20"             ry="20"             width="{$PIwidth*0.89}"             height="{$PIheight*0.9}"             stroke-width="2"             stroke="black"             fill="{$CLproif}"             transform="scale({$Scaling})"/>        <polyline points="{$PIx1},{$PIy1} {$PIx2},{$PIy2} {$PIx3},{$PIy3} {$PIx4},{$PIy3} {$PIx5},{$PIy4}"             stroke="black"             fill="none"             stroke-width="2"             transform="scale({$Scaling})"/>        <!-- if applicable toProcess linkToEpcId="x"-->        <xsl:choose>            <xsl:when test="count(toProcess)>0">                <xsl:variable name="px"><xsl:value-of select="graphics/position/ @width*0.25"/></xsl:variable>                <xsl:variable name="py"><xsl:value-of select="graphics/position/ @height*0.85"/></xsl:variable>                <xsl:variable name="epclink">epcId<xsl:value-of select="toProcess/ @linkToEpcId"/><xsl:text>.html</xsl:text></xsl:variable>            <text x="{graphics/position/ @x + $px}"                 y="{graphics/position/ @y + $py}"                 font-size="10pt"                 fill="blue"                 transform="scale({$Scaling})">                <a xlink:href="{$epclink}"                     target="view_svg">Link to process: <xsl:value-of select="toProcess/ @linkToEpcId"/></a>            </text>            </xsl:when>            <xsl:otherwise/>        </xsl:choose>        <text x="{graphics/position/ @x+10}"             y="{graphics/position/ @y+16}"             font-size="10pt"             fill="green"             transform="scale({$Scaling})">ProcessIF ID: <xsl:value-of select="@id"/>        </text>        <xsl:variable name="yMitte">            <xsl:value-of select="graphics/position/@height*0.5"/>        </xsl:variable>        <xsl:variable name="xeinzug">            <xsl:value-of select="graphics/position/@width*0.2"/>        </xsl:variable>        <xsl:call-template name="Text">            <xsl:with-param name="Text" select="name"/>            <xsl:with-param name="x" select="graphics/position/@x"/>            <xsl:with-param name="y" select="graphics/position/@y"/>            <xsl:with-param name="yMitte" select="$yMitte"/>            <xsl:with-param name="xeinzug" select="$xeinzug"/>        </xsl:call-template>        <!--text x="{graphics/position/ @x+$xeinzug}"             y="{graphics/position/ @y+$yMitte}"             font-size="12pt"             font-style="italic"             fill="{$CLTag}"             transform="scale({$Scaling})">            <xsl:value-of select="name"/>        </text-->    </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    arc template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="arc"> 'my position info arc'    <g epc="arc"  id="@id">        <xsl:element name="polyline">            <xsl:attribute name="points">                <xsl:for-each select="graphics/position">                    <xsl:value-of select="concat(@x,',',@y,' ')"/>                </xsl:for-each>            </xsl:attribute>            <xsl:attribute name="stroke">black</xsl:attribute>            <xsl:attribute name="stroke-dasharray">0.25% 0.25% 0.25%</xsl:attribute>            <xsl:attribute name="fill">none</xsl:attribute>            <xsl:attribute name="transform">scale(<xsl:value-of select="$Scaling"/>)</xsl:attribute>            <xsl:attribute name="style">marker-end:url(#arrow)</xsl:attribute>        </xsl:element>        <xsl:choose>            <xsl:when test="count(graphics/position)>2">                <text x="{child::graphics/position[position()=2]/ @x+10}"                     y="{child::graphics/position[position()=2]/ @y+15}"                     font-size="10pt"                     fill="green"                     transform="scale({$Scaling})">ARC ID: <xsl:value-of select="@id"/>                </text>            </xsl:when>            <xsl:otherwise>                <text x="{child::graphics/position[position()=1]/ @x+15}"                     y="{child::graphics/position[position()=1]/ @y+15}"                     font-size="10pt"                     fill="green"                     transform="scale({$Scaling})">ARC ID: <xsl:value-of select="@id"/>                </text>            </xsl:otherwise>        </xsl:choose>    </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    xor template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="xor"> 'my position info xor'    <g epc="xor" id="@id">        <xsl:variable name="xMitte">            <xsl:value-of select="graphics/position/@x+graphics/position/@width*0.5"/>        </xsl:variable>        <xsl:variable name="yMitte">            <xsl:value-of select="graphics/position/@y+graphics/position/@height*0.5"/>        </xsl:variable>        <circle cx="{$xMitte}"             cy="{$yMitte}"             r="{graphics/position/ @height*0.5}"             width="{graphics/position/ @width}"             height="{graphics/position/ @height}"             stroke-width="2"             stroke="black"             fill="{$CLconector}"             transform="scale({$Scaling})"/>        <!-- draw X symbol -->        <xsl:variable name="lang">            <xsl:value-of select="graphics/position/@height*0.5"/>        </xsl:variable>        <xsl:variable name="ay0">            <xsl:value-of select="$yMitte - $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ax0">            <xsl:value-of select="$xMitte - $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ay1">            <xsl:value-of select="$yMitte + $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ax1">            <xsl:value-of select="$xMitte + $lang*0.6"/>        </xsl:variable>        <line x1="{$ax0}"             y1="{$ay0}"             x2="{$ax1}"             y2="{$ay1}"             style="stroke-width:5;stroke:black"             transform="scale({$Scaling})"/>        <line x1="{$ax0}"             y1="{$ay1}"             x2="{$ax1}"             y2="{$ay0}"             style="stroke-width:5;stroke:black"             transform="scale({$Scaling})"/>        <text x="{$xMitte + $lang}"             y="{$yMitte - $lang*0.6}"             font-size="10pt"             fill="green"             transform="scale({$Scaling})">XOR ID: <xsl:value-of select="@id"/>        </text>    </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    or template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="or"> 'my position info or'    <g epc="or" id="@id">        <xsl:variable name="xMitte">            <xsl:value-of select="graphics/position/@x+graphics/position/@width*0.5"/>        </xsl:variable>        <xsl:variable name="yMitte">            <xsl:value-of select="graphics/position/@y+graphics/position/@height*0.5"/>        </xsl:variable>        <circle cx="{$xMitte}"             cy="{$yMitte}"             r="{graphics/position/ @height*0.5}"             width="{graphics/position/ @width}"             height="{graphics/position/ @height}"             stroke-width="2"             stroke="black"             fill="{$CLconector}"             transform="scale({$Scaling})"/>        <!-- draw V symbol -->        <xsl:variable name="lang">            <xsl:value-of select="graphics/position/@height*0.5"/>        </xsl:variable>        <xsl:variable name="ax0">            <xsl:value-of select="$xMitte - $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ay1">            <xsl:value-of select="$yMitte + $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ax1">            <xsl:value-of select="$xMitte + $lang*0.6"/>        </xsl:variable>        <polyline points="{$ax0},{$yMitte -10} {$xMitte},{$ay1} {$ax1},{$yMitte -10}"             stroke="black"             stroke-width="5"             fill="none"             transform="scale({$Scaling})"/>        <text x="{$xMitte + $lang}"             y="{$yMitte - $lang*0.6}"             font-size="10pt"             fill="green"             transform="scale({$Scaling}) translate(0,{-7})">OR ID: <xsl:value-of select="@id"/>        </text>    </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    and template    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template match="and"> 'my position info and'    <g epc="and" id="@id">        <xsl:variable name="xMitte">            <xsl:value-of select="graphics/position/@x+graphics/position/@width*0.5"/>        </xsl:variable>        <xsl:variable name="yMitte">            <xsl:value-of select="graphics/position/@y+graphics/position/@height*0.5"/>        </xsl:variable>        <circle cx="{$xMitte}"             cy="{$yMitte}"             r="{graphics/position/ @height*0.5}"             width="{graphics/position/ @width}"             height="{graphics/position/ @height}"             stroke-width="2"             stroke="black"             fill="{$CLconector}"             transform="scale({$Scaling})"/>        <!-- draw AND symbol -->        <xsl:variable name="lang">            <xsl:value-of select="graphics/position/@height*0.5"/>        </xsl:variable>        <xsl:variable name="ay0">            <xsl:value-of select="$yMitte - $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ax0">            <xsl:value-of select="$xMitte - $lang*0.6"/>        </xsl:variable>        <xsl:variable name="ax1">            <xsl:value-of select="$xMitte + $lang*0.6"/>        </xsl:variable>        <polyline points="{$ax0},{$yMitte +10} {$xMitte},{$ay0} {$ax1},{$yMitte +10}"             stroke="black"             stroke-width="5"             fill="none"             transform="scale({$Scaling}) translate(0,7)"/>        <text x="{$xMitte + $lang}"             y="{$yMitte - $lang*0.6}"             font-size="10pt"             fill="green"             transform="scale({$Scaling})">AND ID: <xsl:value-of select="@id"/>        </text>    </g>    </xsl:template>    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    text labels    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->    <xsl:template name="Text" mode="Text">        <xsl:param name="Text"/>        <xsl:param name="x"/>        <xsl:param name="y"/>        <xsl:param name="yMitte"/>        <xsl:param name="xeinzug"/>        <xsl:param name="offset" select="0"/>        <xsl:variable name="linecount">            <xsl:choose>                <xsl:when test="$offset=0">                        <xsl:call-template name="lines">                            <xsl:with-param name="text" select="$Text"/>                        </xsl:call-template>                </xsl:when>                <xsl:otherwise>                    <xsl:value-of select="$offset"/>                </xsl:otherwise>            </xsl:choose>        </xsl:variable>        <xsl:choose>            <xsl:when test="contains($Text,'&#xA;')">                <text x="{$x+$xeinzug}"                     y="{$y+$yMitte+(-10)*$linecount}"                     font-size="12pt"                     font-style="italic"                     fill="{$CLTag}"                     transform="scale({$Scaling})">                    <xsl:value-of select="substring-before($Text,'&#xA;')"/>                </text>                <xsl:call-template name="Text">                    <xsl:with-param name="Text" select="substring-after($Text,'&#xA;')"/>                    <xsl:with-param name="x" select="$x"/>                    <xsl:with-param name="y" select="$y+20"/>                    <xsl:with-param name="yMitte" select="$yMitte"/>                    <xsl:with-param name="xeinzug" select="$xeinzug"/>                    <xsl:with-param name="offset" select="$linecount"/>                </xsl:call-template>            </xsl:when>                        <xsl:otherwise>                <text x="{$x+$xeinzug}"                     y="{$y+$yMitte+(-10)*$linecount}"                     font-size="12pt"                     font-style="italic"                     fill="{$CLTag}"                     transform="scale({$Scaling})">                    <xsl:value-of select="$Text"/>                </text>            </xsl:otherwise>        </xsl:choose>    </xsl:template>        <xsl:template name="lines" mode="lines">    <xsl:param name="text"/>    <xsl:param name="count" select="0"/>        <xsl:choose>            <xsl:when test="contains($text,'&#xA;')">                <xsl:call-template name="lines">                    <xsl:with-param name="text" select="substring-after($text,'&#xA;')"/>                    <xsl:with-param name="count" select="$count+1"/>                </xsl:call-template>            </xsl:when>                        <xsl:otherwise>                <xsl:value-of select="$count"/>            </xsl:otherwise>        </xsl:choose>    </xsl:template>    </xsl:stylesheet>