Subject: RE: [xsl] [XSL] extracting a verse From: "Passin, Tom" <tpassin@xxxxxxxxxxxx> Date: Wed, 18 Dec 2002 11:54:52 -0500 |
[Jim_Albright@xxxxxxxxxxxx] > Yes the example I gave was simplified. There can be other > elements present that would exclude a simple text() answer. > I thought it might be too simplified, but you have picked up on a useful way of thinking about the problem, which is what I hoped to convey. > But it got me thinking. Is there a way of saying > > the intersection of > all nodes following verse with id="BCV-GEN-1.1" > AND > all nodes preceding verseEnd with id="BCV-GEN-1.1-END" > > If so that would give me all the nodes contained within > verse. My vocabulary is of Venn diagrams. > Yes, in xslt 1.0 you can form intersections. How to do so is a bit arcane - for two node sets $A and $B, the intersection is $A[count(.|$B) = count($B)] This expression selects nodes that are common to both $A and $B. The idiom is in various FAQs and is shown in the 2nd edition of Mike Kay's book "XSLT Programmer's reference) on page 425. Some processors have extensions for intersections, and xslt2.0 will make it easier, I understand. This approach will work as long as you can specify the criteria for inclusion in the intersection. However, for a large work, it may execute slowly since the processor may have to look through and check each element (or each verse element) in the document, perhaps several times, as it checks each member of the two sets. That is one reason why it is usually better to use containing elements rather than marker elements (your verse elements function as markers in the text). However, if you cannot redesign the xml format then this approach ought to work. I have used it for screen-scraping html pages with good success. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [XSL] extracting a verse, G. Ken Holman | Thread | RE: [xsl] [XSL] extracting a verse, McNally, David |
Re: [xsl] White space required b/w , Wendell Piez | Date | RE: [xsl] [XSL] extracting a verse, Wendell Piez |
Month |