My source document is:
<?xml version="1.0" encoding="UTF8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:fn="http://www.w3.org/2005/xpathfunctions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 schema\BPMN20.xsd" targetNamespace="http://schema.omg.org/spec/BPMN/2.0">
<process id="DA444C7EB7A92BC0EC615091EFE52E9F" name="Process111">
<laneSet>
<lane id="BE805267E22661E25210E901418B7DA2" name="Lane111" >
<flowNodeRefs>E705CE86B8897B266BA6AC81E2F1A5BC</flowNodeRefs>
<flowNodeRefs>643E3A26322BEECB2DBD84BF2A6F9CA5</flowNodeRefs>
</lane>
<lane id="2F92C8B27CE52AFDB382D4EAC634E634" name="Lane222" >
<flowNodeRefs>A65A0630689FA02F3BBB6AC27D906603</flowNodeRefs>
<flowNodeRefs>DDA49A7836C13B7DC3208778C4B03526</flowNodeRefs>
</lane>
</laneSet>
<startEvent id="E705CE86B8897B266BA6AC81E2F1A5BC" name="Start111" />
<endEvent id="643E3A26322BEECB2DBD84BF2A6F9CA5" name="End111" />
<startEvent id="A65A0630689FA02F3BBB6AC27D906603" name="Start222" />
<terminateEvent id="DDA49A7836C13B7DC3208778C4B03526" name="Terminate111" />
</process>
<process id="A7F84E7EA73F9436DCB925D5C3208227" name="Process2222">
<laneSet>
<lane id="B8EE1D7AA494C6D25656434F1CAF803F" name="Lane444" />
</laneSet>
</process>
</definitions>
I want to tranform to the target document:
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns.x="org.w3c.dom.svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<g id="BPMNDIAGRAM" transform="scale(1)">
<g id="POOLS" class="POOLS">
<g id="DA444C7E-B7A9-2BC0-EC61-5091EFE52E9F" class="POOL" >
<g >
<text >
<tspan >Process111</tspan>
</text>
</g>
<g id="BE805267-E226-61E2-5210-E901418B7DA2" class="LANE" PoolID="DA444C7E-B7A9-2BC0-EC61-5091EFE52E9F">
<g>
<text >
<tspan>Lane111</tspan>
</text>
</g>
<g id="EVENTS_BE805267-E226-61E2-5210-E901418B7DA2" class="EVENTS">
<g id="643E3A26-322B-EECB-2DBD-84BF2A6F9CA5" class="ENDEVENT" LaneID="BE805267-E226-61E2-5210-E901418B7DA2">
<text >
<tspan >End111</tspan>
</text>
</g>
<g id="E705CE86-B889-7B26-6BA6-AC81E2F1A5BC" class="STARTEVENT" LaneID="BE805267-E226-61E2-5210-E901418B7DA2">
<text >
<tspan x="0" dy="10">Start111</tspan>
</text>
</g>
</g>
</g>
<g id="2F92C8B2-7CE5-2AFD-B382-D4EAC634E634" class="LANE" PoolID="DA444C7E-B7A9-2BC0-EC61-5091EFE52E9F">
<g >
<text >
<tspan x="0" dy="10">Lane222</tspan>
</text>
</g>
<g id="EVENTS_2F92C8B2-7CE5-2AFD-B382-D4EAC634E634" class="EVENTS">
<g id="A65A0630689FA02F3BBB6AC27D906603" class="STARTEVENT" LaneID="2F92C8B2-7CE5-2AFD-B382-D4EAC634E634">
<text >
<tspan x="0" dy="10">Start222</tspan>
</text>
</g>
<g id="DDA49A78-36C1-3B7D-C320-8778C4B03526" class="TERMINATEEVENT" LaneID="2F92C8B2-7CE5-2AFD-B382-D4EAC634E634">
<text >
<tspan x="0" dy="10">Terminate111</tspan>
</text>
</g>
</g>
</g>
</g>
<g id="A7F84E7E-A73F-9436-DCB9-25D5C3208227" class="POOL" >
<g >
<text >
<tspan >Process2222</tspan>
</text>
</g>
<g id="B8EE1D7A-A494-C6D2-5656-434F1CAF803F" class="LANE" PoolID="A7F84E7E-A73F-9436-DCB9-25D5C3208227">
<g >
<text >
<tspan>Lane444</tspan>
</text>
</g>
</g>
</g>
</g>
</g>
</svg>
And my transformation file is as following code:
<?xml version="1.0" encoding="Windows-1252"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<!-- BPMN 2.0 Transformation: BPMN2.0 xml-to-SVG xml -->
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<svg>
<xsl:attribute name="xmlns.x">org.w3c.dom.svg</xsl:attribute>
<xsl:attribute name="targetNamespace">http://schema.omg.org/spec/BPMN/2.0</xsl:attribute>
<xsl:call-template name="rootElementTemplate"/>
</svg>
</xsl:template>
<!-- rootElementTemplate -->
<xsl:template name="rootElementTemplate">
<g>
<!--call the other templates-->
<xsl:call-template name="pools"/>
</g>
</xsl:template>
<xsl:template name="pools">
<g>
<xsl:attribute name="id">POOLS</xsl:attribute>
<xsl:attribute name="class">POOLS</xsl:attribute>
<xsl:apply-templates select="process"/>
</g>
</xsl:template>
<xsl:template match="process">
<g>
<xsl:attribute name="id"><xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="class">POOL</xsl:attribute>
<xsl:call-template name="text1"/>
</g>
</xsl:template>
<xsl:template name="text1" >
<xsl:for-each select="@name">
<g >
<xsl:element name="text">
<xsl:element name="tspan"><xsl:value-of select= "."/></xsl:element>
</xsl:element>
</g>
</xsl:for-each>
</xsl:template>
<xsl:template match="lane">
<g id="{@id}" class="LANE" >
<xsl:apply-templates select="@name"/>
<xsl:variable name="p" select="count(preceding-sibling::lane)+1"/>
<xsl:variable name="ref" select="ancestor::process/*[$p+1]"/>
<xsl:apply-templates select="$ref"/>
</g>
</xsl:template>
<xsl:template match="startevent">
<g id="{@id}" class="STARTEVENT" name="{@name}" />
</xsl:template>
</xsl:stylesheet>
I don't know why it doesn't work? Please help me