[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: multi-paragraph blockquotes

Subject: Re: multi-paragraph blockquotes
From: Bruce D'Arcus <bdarcus@xxxxxxxxx>
Date: Fri, 6 May 2005 20:14:28 -0400
multi paragraph quote
On May 6, 2005, at 12:09 PM, David Carlisle wrote:

So for HTML or XHTML1.x I think that using a div (which basically is p
with a fixed content mode) produces semantically more meaningful html
files than using p and arbitrarily splitting up a paragraph into
multiple p's so that block level elements come between teh
sub-paragraphs not within them.

I understand your point on this David, but in my case I need to be able to match my output to the logic of input systems (in this case Word*), so I went with this solution:


<xsl:template
match="db:section/db:para | db:chapter/db:para | db:article/db:para">
<xsl:for-each-group select="node()"
group-adjacent="self::db:orderedlist or self::db:unorderedlist or self::db:blockquote">
<xsl:choose>
<xsl:when test="current-grouping-key()">
<xsl:copy-of select="current-group()"/>
</xsl:when>
<xsl:otherwise>
<p>
<xsl:copy-of select="current-group()"/>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
</xsl:template>


I still want to figure out how to assign different class attributes depending on where the p element is ("body text" vs. "body text first indent"), but this works nicely for now.

Bruce

* As with a lot of publishers, mine asks for Word docs. I consider it an accomplishment that they didn't freak when I gave them xhtml!

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.