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

Re: [XSL] extracting a verse

Subject: Re: [XSL] extracting a verse
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 18 Dec 2002 14:57:02 -0500
Re:  [XSL] extracting a verse
Michael,

I think you'll have found, trying your code on (e.g.) the sample I supplied, the below is a work in progress. :->

Nonetheless it's good to see that another bear has been caught by this honey of a problem. Eventually with so many smart people working on it, it is bound to become more tractable. (I already put in my $0.02: it's a job for a streaming transform, SAX-style, not XSLT.) Let us know as you make progress on its deeper aspects.

Cheers,
Wendell

At 02:26 PM 12/18/2002, you wrote:
I started thinking about this, and I think I have an approach somewhere in between the JITT and the BUVH. Its pretty simple, actually, so I am wondering if there is a reason that this didn't already come up. I can't really play around with it anymore, but this might be a step...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/quote">
<xsl:for-each select="verse">
<xsl:call-template name="showverse">
<xsl:with-param name="vcont" select="."></xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>


   <xsl:template name="showverse">
       <xsl:param name="vcont"/>
       <xsl:call-template name="nextsib">
           <xsl:with-param name="csib" select="following::*"/>
       </xsl:call-template><hr/>
   </xsl:template>

   <xsl:template name="nextsib">
       <xsl:param name="csib"/>
       <xsl:value-of select="$csib[1]"/>
       <xsl:if test="name($csib[1])!='endVerse'">
           <xsl:call-template name="nextsib">
               <xsl:with-param name="csib" select="$csib/descendant::*"/>
           </xsl:call-template>
           <xsl:if test="not($csib/descendant::endVerse)">
               <xsl:call-template name="nextsib">
                   <xsl:with-param name="csib" select="$csib/following::*"/>
               </xsl:call-template>
           </xsl:if>
       </xsl:if>
   </xsl:template>

</xsl:stylesheet>


======================================================================
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
======================================================================


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.