You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2010/07/14 08:18:25 UTC
svn commit: r963954 -
/synapse/trunk/java/modules/migrator/src/main/resources/synapse-configuration-migrator.xslt
Author: ruwan
Date: Wed Jul 14 06:18:24 2010
New Revision: 963954
URL: http://svn.apache.org/viewvc?rev=963954&view=rev
Log:
fixing the migrator xslt to take comments into account
Modified:
synapse/trunk/java/modules/migrator/src/main/resources/synapse-configuration-migrator.xslt
Modified: synapse/trunk/java/modules/migrator/src/main/resources/synapse-configuration-migrator.xslt
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/migrator/src/main/resources/synapse-configuration-migrator.xslt?rev=963954&r1=963953&r2=963954&view=diff
==============================================================================
--- synapse/trunk/java/modules/migrator/src/main/resources/synapse-configuration-migrator.xslt (original)
+++ synapse/trunk/java/modules/migrator/src/main/resources/synapse-configuration-migrator.xslt Wed Jul 14 06:18:24 2010
@@ -41,17 +41,29 @@ This is the synapse migration xslt which
<xsl:if test="not(syn:sequence[@name='main'] or synNew:sequence[@name='main'])">
<xsl:element name="sequence" namespace="http://synapse.apache.org/ns/2010/04/configuration">
<xsl:attribute name="name">main</xsl:attribute>
- <xsl:for-each select="syn:* | synNew:*">
+ <xsl:for-each select="syn:* | synNew:* | comment()">
<xsl:if test="local-name()!='sequence' and local-name()!='localEntry' and local-name()!='proxy' and local-name()!='task' and local-name()!='endpoint'">
- <xsl:call-template name="convertNS"/>
+ <xsl:choose>
+ <xsl:when test="self::comment()">
+ <xsl:if test="local-name(following-sibling::*[position()=1])!='localEntry' and local-name(following-sibling::*[position()=1])!='sequence' and local-name(following-sibling::*[position()=1])!='proxy' and local-name(following-sibling::*[position()=1])!='task' and local-name(following-sibling::*[position()=1])!='endpoint'">
+ <xsl:copy-of select="self::comment()" xml:space="preserve"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="convertNS"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:element>
</xsl:if>
- <xsl:for-each select="syn:* | synNew:*">
+ <xsl:for-each select="syn:* | synNew:* | comment()">
<xsl:if test="local-name()='sequence' or local-name()='localEntry' or local-name()='proxy' or local-name()='task' or local-name()='endpoint'">
<xsl:apply-templates select="."/>
</xsl:if>
+ <xsl:if test="self::comment() and (local-name(following-sibling::*[position()=1])='localEntry' or local-name(following-sibling::*[position()=1])='proxy' or local-name(following-sibling::*[position()=1])='task' or local-name(following-sibling::*[position()=1])='sequence' or local-name(following-sibling::*[position()=1])='endpoint')">
+ <xsl:copy-of select="self::comment()" xml:space="preserve"/>
+ </xsl:if>
</xsl:for-each>
</xsl:element>
</xsl:template>