Ich habe eine XML-Datei, die ich mit XSLT transformieren möchte. Die Idee ist, alles, was vor jeder <paragraph/>
Tags in <p></p>
Tags ist.kann nicht mit XPath auf Textblock zugreifen
XML-Datei:
<section>
Hello everyone, I'm
<bold>Hackmania</bold>
<bold>15</bold>
<line/>
I am looking for an
<highlight>answer</highlight>
<paragraph/>
Here is an other
<bold>paragraph</bold>
<highlight>with the same tags</highlight>
<paragraph/>
</section>
Gesucht transformiert XML:
<section>
<p>
Hello everyone, I'm
<bold>Hackmania</bold>
<bold>15</bold>
<line/>
I am looking for an
<highlight>answer</highlight>
</p>
<p>
HHere is an other
<bold>paragraph</bold>
<highlight>with the same tags</highlight>
</p>
</section>
Und hier ist meine XSL-Datei:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet>
<xsl:template match="/">
<section>
<xsl:apply-templates/>
</section>
</xsl:template>
<xsl:template match="paragraph">
<xsl:for-each select=".">
<p>
<xsl:apply-templates select="/*/*[preceding-sibling::paragraph]"/>
</p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Vielen Dank im Voraus für die Ihnen helfen.
danke für Ihre Hilfe @ michael.hor257k. – Hackmania15