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

RE: blockQuotes to blockQuote p p

Subject: RE: blockQuotes to blockQuote p p
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 2 May 2003 09:33:30 +0100
block quotes
The following rules should handle this:

<xsl:template match="blockQuotes" priority="20">
<blockQuotes>
  <p><xsl:apply-templates/></p>
  <xsl:apply-template match="following-sibling::*[1][self::blockQuotes]"
        mode="continue"/>
</blockQuotes>
</xsl:template>

<xsl:template
match="blockQuotes[preceding-sibling::*[1][self::blockQuotes]]" 
     priority="30"/>

<xsl:template
match="blockQuotes[preceding-sibling::*[1][self::blockQuotes]]"
priority="30">
  <p><xsl:apply-templates/></p>
  <xsl:apply-template match="following-sibling::*[1][self::blockQuotes]"
        mode="continue"/>
</xsl:template>

In XSLT 2.0 you can use xsl:for-each-group - there is a very similar
example in the spec.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Jim_Albright@xxxxxxxxxxxx
> Sent: 01 May 2003 20:00
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  blockQuotes to blockQuote p p
> 
> 
> I am having problems with the blockQuotes area of this input file
> 
> <section>
>         <head></head>
>         <parallelPassage></parallelPassage>
>         <paragraph></paragraph>
>         <blockQuotes></blockQuotes>
>         <blockQuotes></blockQuotes>
>         <blockQuotes></blockQuotes>
>         <paragraph></paragraph>
>         <paragraph></paragraph>
>         <blockQuotes></blockQuotes>
>         <blockQuotes></blockQuotes>
>         <blockQuotes></blockQuotes>
>         <paragraph></paragraph>
> </section>
> 
> output should be:
> 
> <div>
>         <head></head>
>         <parallelPassage></parallelPassage>
>         <p></p>
>         <blockQuote>
>                 <p></p>
>                 <p></p>
>                 <p></p>
>         </blockQuote>
>         <p></p>
>         <p></p>
>         <blockQuote>
>                 <p></p>
>                 <p></p>
>                 <p></p>
>         </blockQuote>
>         <p></p>
> </div>
> 
> I have been trying to get this with a for-each and XPath, but 
> am wondering 
> it this should be handled by recursion instead. If recursion 
> is the answer 
> I could use some help getting it started. 
> 
> 
> Jim Albright
> 704 843-0582
> Wycliffe Bible Translators
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.