Subject: Re: [xsl] [XSL] extracting a verse From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 18 Dec 2002 14:57:02 -0500 |
Cheers, Wendell
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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [XSL] extracting a verse, Michael H. Semcheski | Thread | Re: [xsl] [XSL] extracting a verse, Michael H. Semcheski |
Re: [xsl] [XSL] extracting a verse, Michael H. Semcheski | Date | RE: [xsl] [XSL] extracting a verse, McNally, David |
Month |