Subject: RE: [xsl] Transformation problem tei > xhtml From: <Jarno.Elovirta@xxxxxxxxx> Date: Tue, 12 Apr 2005 09:22:35 +0300 |
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>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Transformation problem te, James Fuller | Thread | [xsl] TRAX-like API for FO processo, Peter Gerstbach |
Re: [xsl] XSLT 1.0 Grouping, Mukul Gandhi | Date | Re: [xsl] Transformation problem te, James Fuller |
Month |