Heho Thomas,
besten Dank für deine Hilfe! Ich habe meine Aufgabe lösen können.
Hier mal der XSL-Code:
  
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
    <xsl:key name="content1-only" match="element" use="@attribute1"/>  
    <xsl:template name="MyFunc">  
        <xsl:param name="string"/>  
        <xsl:variable name="length" select="string-length($string)"/>  
        <xsl:choose>  
            <xsl:when test="contains($string,'#')">  
                <xsl:value-of select="substring-before($string,'#')"/>  
                <xsl:copy-of select="' '"/>  
                <xsl:text>
			#</xsl:text>  
                <xsl:call-template name="MyFunc">  
                    <xsl:with-param name="string"  
                                    select="substring-after($string,'#')"/>  
                    <xsl:with-param name="from" select="'#'"/>  
                    <xsl:with-param name="to" select="' '" />  
                </xsl:call-template>  
            </xsl:when>  
            <xsl:otherwise>  
                <xsl:choose>  
                    <xsl:when test="$length=2">  
                        <xsl:text>[]"</xsl:text>  
                    </xsl:when>  
                    <xsl:otherwise>  
                        <xsl:value-of select="substring-before($string,']')" />  
                        <xsl:text>
			]"</xsl:text>  
                    </xsl:otherwise>  
                </xsl:choose>  
            </xsl:otherwise>  
        </xsl:choose>  
    </xsl:template>  
  
    <xsl:template match="data">  
        <xsl:text>
</xsl:text>  
        <data>  
            <xsl:apply-templates>  
            </xsl:apply-templates>  
        </data>  
    </xsl:template>  
  
    <xsl:template match="element">  
        <xsl:text disable-output-escaping="yes">	<element</xsl:text>  
        <xsl:text>
		attribute1 = "</xsl:text>  
        <xsl:call-template name="MyFunc">  
            <xsl:with-param name="string" select="@attribute1"/>  
        </xsl:call-template>  
        <xsl:text>
		attribute2 = "</xsl:text>  
        <xsl:call-template name="MyFunc">  
            <xsl:with-param name="string" select="@attribute2"/>  
        </xsl:call-template>  
        <xsl:text disable-output-escaping="yes">/></xsl:text>  
    </xsl:template>  
  
</xsl:stylesheet>  
Wenn noch jemanden Verbesserungsvorschläge zur Optimierung des Codes hat, bin ich für jeden Tipp dankbar :)
 nicht angemeldet
 nicht angemeldet