xsl-list
[Top] [All Lists]

RE: [XSL] extracting a verse

2002-12-18 14:52:03
Hi David,

At 03:45 PM 12/18/2002, you wrote:
If you just want to get the text within verses, then there is a very simple
solution with keys.  Assign keys to all text nodes - the key is the
concatenation of the ID of the verse that precedes the text node and the ID
of the verseEnd that follows it.  It's then easy to use the key to pull all
the text nodes for a given verse.

Thanks for bringing this up. It's a very useful approach, a version of the "levitation" method for interpolating structure into a flat sequence (which is an application of grouping in general). In the case of the requirements you cite (throw away all other markup, keep just the text nodes wrapped in their correct verses), it's the method I would prefer.

Just as a footnote, it may be worth mentioning that using this technique, you don't actually need your <endVerse/> elements, since you can key each text node simply to the <verse/> element that most recently precedes it.

If anyone's interested, you'll also find a thread on this problem from earlier this year, in the archives of TEI-L, under the threads "Re: Bible Markup" and "XSLT caveats (was: Re: Bible Markup)". Check out http://listserv.brown.edu/archives/cgi-bin/wa?S1=tei-l (I found the threads by searching for "flat or hierarchy").

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
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



<Prev in Thread] Current Thread [Next in Thread>