|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Transformation problem tei > xhtml
Hi,
> In TEI, this might be encoded as follows (2):
>
> <p>Text text text:
> <quote>
> <p>Quotation quotation quotation.</p>
> </quote>
> More comment on this quotation.
> <quote>
> <p>Another long quotation.</p>
> </quote>
> </p>
>
> In valid XHTML, however, <p> can't contain the equivalent block level
> elements like <blockquote>, <table>, <list>, so the text
> would need to
> be encoded (3):
>
> <p>Text text text:</p>
> <blockquote>
> <p>Quotation quotation quotation.</p>
> </blockquote>
> <p>More comment on this quotation.</p>
> <blockquote>
> <p>Another long quotation.</p>
> </blockquote>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
<xsl:template match="/p">
<xsl:apply-templates select="node()[1]" mode="group"/>
</xsl:template>
<xsl:template match="quote">
<blockquote>
<xsl:apply-templates/>
</blockquote>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="text()" mode="group">
<xsl:if test="normalize-space()">
<p>
<xsl:apply-templates select="."/>
</p>
</xsl:if>
<xsl:apply-templates select="following-sibling::node()[1]" mode="group"/>
</xsl:template>
<xsl:template match="*" mode="group">
<xsl:apply-templates select="."/>
<xsl:apply-templates select="following-sibling::node()[1]" mode="group"/>
</xsl:template>
</xsl:stylesheet>
I.e. Tree Walker grouping aka Levitation.
Cheers,
Jarno - Mark Tyler: July 2002 Mix <www.hardnrg.com>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








