Subject: Re: [xsl] paras with nested block-level elements to XHTML mix of <p>s and flattened block-level elements From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 01 Aug 2008 15:00:20 -0400 |
My question concerns X/HTML as the transformation target, where "p" is the lowest level block-level element, which admits no other block-level element(s) as content, but the source is a model (like DocBook, TEI, etc.) which allows (and has) a variety of block level content in paragraphs.
This doesn't appear to be a new problem... but while I've tried, I just haven't been able to track down any definitive solutions.
<xsl:template match="p"> <xsl:for-each-group select="node()" group-adjacent="u:block-level(.)"> <xsl:choose> <xsl:when test="current-grouping-key()"> <xsl:apply-templates select="current-group()"/> </xsl:when> <xsl:otherwise> <p> <xsl:apply-templates select="current-group()"/> </p> </xsl:otherwise> </xsl:for-each-group> </xsl:template>
I hope that helps -- Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] paras with nested block-level, Daniel Grossberg | Thread | Re: [xsl] paras with nested block-l, Syd Bauman |
[xsl] paras with nested block-level, Daniel Grossberg | Date | Re: [xsl] paras with nested block-l, Syd Bauman |
Month |