<?xml version="1.0" encoding="UTF-8" ?>
<!--=================================================
================= script header =====================
=====================================================

	script version 1.2.1
	supported iteraplan versions 6.1
	last update Feb 07 2018
	
-->
<xsl:stylesheet version="2.0" 
	xmlns="http://graphml.graphdrawing.org/xmlns" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	xmlns:iteraplan="urn:iteraplan"	
	xmlns:y="http://www.yworks.com/xml/graphml" 
	xmlns:g="http://graphml.graphdrawing.org/xmlns" 
	xmlns:dn="myPersonalNamespace">
	
	<xsl:output method="xml" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/>

<!--=================================================
================ global variables ===================
==================================================-->
	<!-- Load external documents. Check availability in main template. Layout files are optional. -->
	<!-- NOTE: not implemented for public demo scripts -->

	<!-- Load full iteraplan model -->
	<xsl:variable name="fullModel" select="/iteraplan:Container" />
	<xsl:variable name="baseURL" select="'https://YourURL/TOLUY/'" />

<!--=================================================
============= document processing ===================
==================================================-->

	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Start processing the full model by matching the root node "iteraplan:Container"
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
	<xsl:template match="iteraplan:Container">
      [INFO] Content was written to clusteredInfoFlow.graphml which can be loaded from the file list on the right!
  	  <xsl:result-document href="clusteredInfoFlow.graphml">
	  
	  <!-- Check availability of external files -->
	  <!-- NOTE: not implemented for public demo scripts -->

	  <!-- Write the graphml header with all necessary configuration of the graphml file (keys) -->
	  <!-- NOTE: no dynamic keys for public demo scripts -->
	  <graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
	   <key id="d0" for="graph" attr.name="Beschreibung" attr.type="string"/>
	   <key id="d1" for="port" yfiles.type="portgraphics"/>
	   <key id="d2" for="port" yfiles.type="portgeometry"/>
	   <key id="d3" for="port" yfiles.type="portuserdata"/>
	   <key id="d4" for="node" attr.name="nodeID" attr.type="string">
	      <default>-1</default>
	   </key>
	   <key id="d5" for="node" attr.name="nodeType" attr.type="string"/>
	   <key id="d6" for="node" attr.name="url" attr.type="string"/>
	   <key id="d7" for="node" attr.name="description" attr.type="string"/>
	   <key id="d8" for="node" yfiles.type="nodegraphics"/>
	   <key id="d9" for="edge" attr.name="edgeID" attr.type="string">
	      <default>-1</default>
	   </key>
	   <key id="d10" for="edge" attr.name="edgeType" attr.type="string"/>
	   <key id="d11" for="edge" attr.name="url" attr.type="string"/>
	   <key id="d12" for="edge" attr.name="description" attr.type="string"/>
	   <key id="d13" for="edge" yfiles.type="edgegraphics"/>
	   <key id="d14" for="graphml" yfiles.type="resources"/>
		<graph edgedefault="directed" id="G">
	  
		  <xsl:variable name="fullGraph">
		    <!-- Add content, select all starting points for further graph creation -->
		    <xsl:apply-templates select="contents[@xsi:type='iteraplan:InformationSystemDomain' and (@name='Management Applications' or @name='External systems')]" />
		    <xsl:apply-templates select="contents[@xsi:type='iteraplan:InformationFlow']" />
		  </xsl:variable>
		  
		  <!-- print node structure -->
		  <xsl:apply-templates select="$fullGraph/*"/>
		  
		  <!-- print edges -->
		  <xsl:copy-of select="$fullGraph//g:edge" />
	  
		</graph>
	  </graphml>
	  </xsl:result-document>
	</xsl:template>


	<!-- helper templates to tell nodes and edges apart -->
	<xsl:template match="node()|@*">
	  <xsl:if test="not(local-name() = 'edge')">
		<xsl:call-template name="nodeStructureOnly" />
	  </xsl:if>  
	</xsl:template>
	
 	<xsl:template name="nodeStructureOnly">
	  <xsl:copy>
		<xsl:apply-templates select="node()|@*"/>
	  </xsl:copy>
	</xsl:template>



<!--=================================================
======== additional templates / functions ===========
==================================================-->	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Evaluates with which template to continue (depending on nesting structure).
	This template is usually customized to select the wanted elements.
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
	<xsl:template name="evaluateRenderTemplate" match="contents">
	  <xsl:param name="id" select="@id" />
	  <xsl:param name="parentId" select="-1" />
	  <xsl:param name="position" select="0" />
	  
	  <!-- $contents is the actual xml node from iteraplan.xmi with the corresponding id -->
	  <xsl:variable name="contents" select="$fullModel/contents[@id=$id]" />
	  
	  <!-- $fullURL is the iteraplan URL to the processed building block -->
	  <xsl:variable name="fullURL" select="dn:getURLByNode(.)" />
	  

	  <!-- start node/edge rendering -->
	  <xsl:choose>
	  	<!-- superordinate ISD, render as group and continue with children -->
	  	<xsl:when test="$contents/@xsi:type='iteraplan:InformationSystemDomain' and $contents/@children">
	  	  <xsl:variable name="customParameters"><xsl:element name="dn:color">#88BBDD</xsl:element></xsl:variable>
		  <xsl:call-template name="renderGroupNode">
		    <xsl:with-param name="id" select="$id" />
		    <xsl:with-param name="node" select="$contents" />
		    <xsl:with-param name="fullURL" select="$fullURL" />
		    <xsl:with-param name="children" select="$contents/@children" />
		    <xsl:with-param name="customParameters" select="$customParameters" />
		  </xsl:call-template>
	  	</xsl:when>
	  
	  	<!-- leaf ISD, render as group and continue with associated IS -->
	  	<xsl:when test="$contents/@xsi:type='iteraplan:InformationSystemDomain' and not($contents/@children)">
	  	  <xsl:variable name="customParameters"><xsl:element name="dn:color">#88BBDD</xsl:element></xsl:variable>
		  <xsl:call-template name="renderGroupNode">
		    <xsl:with-param name="id" select="$id" />
		    <xsl:with-param name="node" select="$contents" />
		    <xsl:with-param name="fullURL" select="$fullURL" />
		    <xsl:with-param name="children" select="$contents/@informationSystemAssociations" />
		    <xsl:with-param name="customParameters" select="$customParameters" />
		  </xsl:call-template>
	  	</xsl:when>
	  	
	  	<!-- IS2ISD Association -->
	  	<xsl:when test="$contents/@xsi:type='iteraplan:Is2IsdAssociation'">
	  	  <xsl:call-template name="evaluateRenderTemplate">
	  	    <xsl:with-param name="id" select="substring-after($contents/@informationSystem, '#')" />
	  	    <xsl:with-param name="parentId" select="$parentId" />
	  	  </xsl:call-template>
	  	</xsl:when>
	  
	  	<!-- superordinate IS, render as group and continue with children -->
	  	<xsl:when test="$contents/@xsi:type='iteraplan:InformationSystem' and $contents/@children">
	  	  <xsl:variable name="customParameters"><xsl:element name="dn:color">#FFFFBB</xsl:element></xsl:variable>
		  <xsl:call-template name="renderGroupNode">
		    <xsl:with-param name="id" select="$id" />
		    <xsl:with-param name="node" select="$contents" />
		    <xsl:with-param name="fullURL" select="$fullURL" />
		    <xsl:with-param name="children" select="$contents/@children" />
		    <xsl:with-param name="customParameters" select="$customParameters" />
		  </xsl:call-template>
	  	</xsl:when>
	  	
	  	<!-- leaf node IS, render as simple node -->
	  	<xsl:when test="$contents/@xsi:type='iteraplan:InformationSystem' and not($contents/@children)">
		  <xsl:call-template name="renderNode">
		    <xsl:with-param name="id" select="$id" />
		    <xsl:with-param name="node" select="$contents" />
		    <xsl:with-param name="color" select="'#FFFFBB'" />
		  </xsl:call-template>
	  	</xsl:when>
	  	
	  	<!-- information flows as edges -->
	  	<xsl:when test="$contents/@xsi:type='iteraplan:InformationFlow'">		
		
			<xsl:variable name="IFID" select="$contents/@id" />
			<xsl:variable name="IS1AID" select="substring-after($contents/@informationSystem1Associations, '#')" />
			<xsl:variable name="IS1ID" select="substring-after($fullModel/contents[@id=$IS1AID]/@informationSystem, '#')" />
			<xsl:variable name="IS2AID" select="substring-after($contents/@informationSystem2Associations, '#')" />
			<xsl:variable name="IS2ID" select="substring-after($fullModel/contents[@id=$IS2AID]/@informationSystem, '#')" />
			<xsl:variable name="BOAIDs" select="$contents/@businessObjectAssociations" />
			
			<xsl:choose>
			  <xsl:when test="$BOAIDs">
				<xsl:for-each select="tokenize($BOAIDs, ' ')">
					<xsl:variable name="BOAID" select="substring-after(., '#')" />
					<xsl:variable name="BOID" select="substring-after($fullModel/contents[@id=$BOAID]/@businessObject, '#')" />
					<xsl:variable name="direction" select="$fullModel/contents[@id=$BOAID]/@direction" />
					
					<xsl:variable name="edge">
					  <xsl:choose>
						<xsl:when test="$direction='FIRST_TO_SECOND'"><dn:source id="{$IS1ID}" arrow="none" /><dn:target id="{$IS2ID}" arrow="standard" /></xsl:when>
						<xsl:when test="$direction='SECOND_TO_FIRST'"><dn:source id="{$IS2ID}" arrow="none" /><dn:target id="{$IS1ID}" arrow="standard" /></xsl:when>
						<xsl:when test="$direction='BOTH_DIRECTIONS'"><dn:source id="{$IS1ID}" arrow="standard" /><dn:target id="{$IS2ID}" arrow="standard" /></xsl:when>
						<xsl:when test="$direction='NO_DIRECTION'"><dn:source id="{$IS1ID}" arrow="none" /><dn:target id="{$IS2ID}" arrow="none" /></xsl:when>
					  </xsl:choose>
					  <dn:BO id="{$BOID}" name="{$fullModel/contents[@id=$BOID]/@name}" />
					  <dn:IF id="{$IFID}" name="{$contents/@name}" />
					</xsl:variable>
					
					<xsl:call-template name="renderLabeledEdge"><xsl:with-param name="edge" select="$edge" /></xsl:call-template>
				</xsl:for-each>
			  </xsl:when>
			  <xsl:otherwise>
			  	<xsl:variable name="edge">
			  	  <dn:source id="{$IS1ID}" arrow="none" /><dn:target id="{$IS2ID}" arrow="none" />
			  	  <dn:BO id="none" name="none" />
				  <dn:IF id="{$IFID}" name="{$contents/@name}" />
			  	</xsl:variable>
			  	<xsl:call-template name="renderLabeledEdge"><xsl:with-param name="edge" select="$edge" /></xsl:call-template>
			  </xsl:otherwise>
			</xsl:choose>

	  	</xsl:when>
	  </xsl:choose>

	</xsl:template>

	
	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Renders the graphml code which is necessary for leaf nodes.
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
	<xsl:template name="renderNode">
	  <xsl:param name="id" />
	  <xsl:param name="node" />
	  <xsl:param name="color" select="'#CCCCCC'" />
	  
	  <!-- only select IS which are in the specified domains AND have interfaces to other IS in the same domains -->
	  <xsl:variable name="ISD1ID" select="concat('#', $fullModel/contents[@name='Management Applications']/@id)" />
	  <xsl:variable name="ISD2ID" select="concat('#', $fullModel/contents[@name='External systems']/@id)" />
	  
	  <xsl:variable name="thisIS-ISDs" select="$fullModel/contents[@informationSystem=concat('#', $id)]/@informationSystemDomain" />
	  
	  <xsl:variable name="IFIDs" select="$fullModel/contents[@informationSystem=concat('#', $id)]/@informationFlow" />
	  <xsl:variable name="tmpISIDs" select="$fullModel/contents[@informationFlow=$IFIDs]/@informationSystem" />
	  <!-- remove current system's id -->
	  <xsl:variable name="ISIDs"><xsl:for-each select="$tmpISIDs"><xsl:if test="not(.=concat('#',$id))"><dn:id><xsl:value-of select="." /></dn:id></xsl:if></xsl:for-each></xsl:variable>
	  <xsl:variable name="connectedIS-ISDs" select="$fullModel/contents[@informationSystem=$ISIDs/dn:id]/@informationSystemDomain" />
	  	  
	  <xsl:if test="($thisIS-ISDs=$ISD1ID or $thisIS-ISDs=$ISD2ID) and ($connectedIS-ISDs=$ISD1ID or $connectedIS-ISDs=$ISD2ID)">
	  
		  <node id="{$id}">
		  	<data key="d4"><xsl:value-of select="$node/@id" /></data>
		  	<data key="d5"><xsl:value-of select="$node/@xsi:type" /></data>
		  	<data key="d7"><xsl:value-of select="$node/@description" /></data>
		  	<data key="d8">
	
	          <y:ShapeNode>
	           	<y:Geometry height="50" width="100" x="0" y="0"/>
	           	<y:Fill color="{$color}" transparent="false"/>
	           	<y:BorderStyle color="#000000" type="line" width="1.0"/>
	           	<y:NodeLabel alignment="center" autoSizePolicy="node_size" configuration="CroppingLabel" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="40.0" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="40.0" x="0.0" y="0.0"><xsl:value-of select="$node/@name" /></y:NodeLabel>
	           	<y:Shape type="rectangle"/>
	          </y:ShapeNode>
	
		  	</data>
		  </node>
	  
	  </xsl:if>

	</xsl:template>
	  

	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Renders the graphml code which is necessary for group nodes.
	Grouping IS are not filtered as leaf IS for this demo script.
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
	<xsl:template name="renderGroupNode">
	  <xsl:param name="id" />
	  <xsl:param name="node" />
	  <xsl:param name="fullURL" />
	  <xsl:param name="children" select="$node/@children"/>
	  <xsl:param name="customParameters" />
	    
	  <node id="{$id}" yfiles.foldertype="group">
	  	<data key="d4"><xsl:value-of select="$node/@id" /></data>
	  	<data key="d5"><xsl:value-of select="$node/@xsi:type" /></data>
	  	<data key="d6"><xsl:value-of select="$fullURL" /></data>
	  	<data key="d7"><xsl:value-of select="$node/@description" /></data>
	  	<data key="d8">
	      <y:ProxyAutoBoundsNode>
			<y:Realizers active="0">
	  	  
            <y:GroupNode>
              <y:Geometry height="150" width="150" x="0" y="0"/>
              <y:Fill color="{$customParameters/dn:color}" transparent="false"/>
              <y:BorderStyle color="#000000" type="line" width="3.0"/>
              <y:NodeLabel alignment="center" autoSizePolicy="node_width" borderDistance="0.0" bottomInset="0" configuration="CroppingLabel" fontFamily="Calibri" fontSize="16" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="26.53125" leftInset="22" modelName="internal" modelPosition="t" rightInset="22" textColor="#000000" topInset="5" visible="true" width="452.9508928571429" x="0.0" y="0.0">
				<xsl:value-of select="$node/@name" />
			  </y:NodeLabel>
              <y:Shape type="rectangle"/>
              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
              <y:BorderInsets bottom="17" bottomF="17.0" left="0" leftF="0.0" right="0" rightF="0.0" top="40" topF="40.0"/>
            </y:GroupNode>
            
            <y:GroupNode>
              <y:Geometry height="50.0" width="190.0" x="0.0" y="0.0"/>
              <y:Fill color="#DDDDDD" transparent="false"/>
              <y:BorderStyle color="#000000" type="line" width="1.0"/>
              <y:NodeLabel alignment="left" autoSizePolicy="node_width" backgroundColor="#DDDDDD" borderDistance="0.0" bottomInset="0" configuration="CroppingLabel" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasLineColor="false" height="32.1875" leftInset="22" modelName="internal" modelPosition="t" rightInset="0" textColor="#000000" topInset="0" visible="true" width="190.0" x="0.0" y="0.0">
				<xsl:value-of select="concat($node/@name, ' (closed)')" />
              </y:NodeLabel>
              <y:Shape type="rectangle"/>
              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="11" topF="11.0"/>
            </y:GroupNode>
			  
			</y:Realizers>
		  </y:ProxyAutoBoundsNode>
	  	</data>
		<graph id="{concat('graph',$id)}" edgedefault="directed">
	  	
		  <xsl:call-template name="splitChildren">
			<xsl:with-param name="childIdString" select="$children" />
			<xsl:with-param name="parentId" select="$node/@id" />
		  </xsl:call-template>

		</graph>
      </node>

	</xsl:template>
	
	
	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Renders the graphml code which is necessary for edges without further data.
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
	<xsl:template name="renderLabeledEdge">
	  <xsl:param name="edge" />
	  
	  <!-- only execute edge rendering if source and target are exisiting. -->
	  <xsl:if test="$edge/dn:source/@id and $edge/dn:target/@id">
	    
	    <xsl:if test="(
	    	$fullModel/contents[@informationSystem=concat('#', $edge/dn:source/@id)]/@informationSystemDomain = concat('#', $fullModel/contents[@name='Management Applications']/@id) 
	    	or 
	    	$fullModel/contents[@informationSystem=concat('#', $edge/dn:source/@id)]/@informationSystemDomain = concat('#', $fullModel/contents[@name='External systems']/@id) 
	    	) and (
	    	$fullModel/contents[@informationSystem=concat('#', $edge/dn:target/@id)]/@informationSystemDomain = concat('#', $fullModel/contents[@name='Management Applications']/@id) 
	    	or 
	    	$fullModel/contents[@informationSystem=concat('#', $edge/dn:target/@id)]/@informationSystemDomain = concat('#', $fullModel/contents[@name='External systems']/@id) 
	    	)">
	    	
		  <xsl:variable name="uniqueID" select="concat($edge/dn:IF/@id, '-', $edge/dn:source/@id, '-', $edge/dn:target/@id, '-', $edge/dn:BO/@id)" />
		  <edge id="{$uniqueID}" source="{$edge/dn:source/@id}" target="{$edge/dn:target/@id}">
		  	<data key="d9"><xsl:value-of select="$uniqueID" /></data>
		  	<data key="d13">
	          <y:PolyLineEdge>
	          	<y:LineStyle color="#000000" type="line" width="1.0"/>
	          	<y:Arrows source="{$edge/dn:source/@arrow}" target="{$edge/dn:target/@arrow}"/>
	          	<y:BendStyle smoothed="false"/>
	          	<y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.701171875" modelName="side_slider" preferredPlacement="anywhere" ratio="0.4677817691962281" textColor="#000000" visible="true" width="36.015625"><xsl:value-of select="$edge/dn:BO/@name" /><y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/></y:EdgeLabel>
	          </y:PolyLineEdge>
		  	</data>
		  </edge>
		</xsl:if>
		
	  </xsl:if>
	</xsl:template>
	
	
	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Splits the list of child IDs and forwards them to the evaluation template.
	In case the list contains duplicates, these will be removed.
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->	
	<xsl:template name="splitChildren">
	  <xsl:param name="childIdString" />
	  <xsl:param name="parentId" />
	  
	  <xsl:variable name="tokenizedChildIDs">
	    <dn:doc>
		<xsl:call-template name="tokenize">
		  <xsl:with-param name="string" select="substring-after($childIdString, '#')"/>
		  <xsl:with-param name="separator" select="' #'"/>
		</xsl:call-template>
		</dn:doc>
	  </xsl:variable>
	  
	  <xsl:variable name="cleanedTokenizedChildIDs">
	  	<xsl:for-each-group select="$tokenizedChildIDs/dn:doc/dn:token" group-by="text()">
          <xsl:sequence select="."/>
      	</xsl:for-each-group>
	  </xsl:variable>
	  
	  <xsl:for-each select="$cleanedTokenizedChildIDs/*">
	  	<xsl:call-template name="evaluateRenderTemplate">
	  	  <xsl:with-param name="id" select="text()" />
	  	  <xsl:with-param name="parentId" select="$parentId" />
	  	  <xsl:with-param name="position" select="@position" />
	  	</xsl:call-template>
	  </xsl:for-each>
	  
	</xsl:template>
	
	
	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Splits a list to a node set of the form 
	<token position=1>value1</token> <token position=2>value2 ...
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->	
	<xsl:template name="tokenize">
	  <xsl:param name="string" />
	  <xsl:param name="separator" select="' #'" />
	  <xsl:param name="counter" select="1" />
	
	  <xsl:choose>
	    <xsl:when test="contains($string,$separator)">
	      <dn:token position="{$counter}"><xsl:value-of select="substring-before($string,$separator)"/></dn:token>
	      <xsl:call-template name="tokenize">
	        <xsl:with-param name="string" select="substring-after($string,$separator)"/>
	        <xsl:with-param name="separator" select="$separator" />
	        <xsl:with-param name="counter" select="$counter + 1" />
	      </xsl:call-template>
	    </xsl:when>
	    
	    <xsl:otherwise>
	      <dn:token position="{$counter}"><xsl:value-of select="$string"/></dn:token>
	    </xsl:otherwise>
	  </xsl:choose>
	</xsl:template>
	
	
	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Returns the URL for the single item view in iteraplan based on a contents
	element.
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->	
	<xsl:function name="dn:getURLByNode">
	  <xsl:param name="node" />
	  
	  <xsl:value-of select="concat($baseURL, 'client/#/single/', substring-after($node/@xsi:type,':'), '/', $node/@id)" />
	</xsl:function>
	
</xsl:stylesheet>