Hallo,
Ich stehe gerade komplett auf dem Schlauch, weil ein XSLT Transformation mir wilde Ergebnisse ausgibt. Ich kann leider nicht den vollen Code hier ausführen, deshalb nur meine Fragestellung, wenn zum Beispiel folgendes XML existiert:
<root>
<one></one>
<two>first text</two>
<two>second text</two>
</root>
im xslt code gibt es u.a. diese templates
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="root"">
<body>
<xsl:apply-templates/>
</body>
</xsl:template>
<xsl:template match="one">
<h1>
<xsl:apply-templates/>
</h1>
</xsl:template>
<xsl:template match="two">
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
Ich erhalte nun als Ergebnis:
<body>
<h1>
<h2>first text</h2>
<h2>second text</h2>
</h1>
</body>
ich hätte aber folgendes Ergebnis erwartet:
<body>
<h1></h1>
<h2>first text</h2>
<h2>second text</h2>
</body>
Mein Frage deshalb: War meine Annahme falsch, dass xsl:apply-templates/ ohne das select Attribute sich immer auf die Unterknoten des aktuellen Knoten bezieht?
Gruß