Re: [xsl] [XSL] extracting a verse

Subject: Re: [xsl] [XSL] extracting a verse
From: "Michael H. Semcheski" <mhs-list@xxxxxxxxx>
Date: Wed, 18 Dec 2002 17:21:45 -0500
Thanks for the encouragement. I can't really say that I will be able to spend any more time on this, but it seemed like there should be a relatively simple tale-recursive solution. (which is what the third template below name="nextsib") really is. The rest is just wrapping.


Wendell Piez wrote:


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





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



Current Thread