У меня есть следующий xml:
<box>
<title>bold text</title>
some text
</box>
и следующий xsl:
<xsl:template match="box">
<p style="background:red;">
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="title">
<p style='background:green;'>
<xsl:apply-templates/>
</p>
</xsl:template>
И я получил следующее:
<p style="background:red;"> </p>
<p style="background:green;">bold text</p>
some text
<p></p>
Но я хочу следующее:
<p style="background:red;">
<p style="background:green;">bold text</p>
some text
</p>
Как мне это сделать?
<p>
элементов друг в друга — не очень хорошая идея. Парсер HTML попытается отсортировать их, отделив их друг от друга, и это то, что вы видите в Firebug. - person Michael Kay   schedule 22.04.2011