[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: grouping flat structure, part three
Now I am thoroughly confused. I am trying to start small and work up.
For example, I would think that this template would group the
@class=NarrBody elements. It groups the questions as well (see output
below).
<xsl:template match="part"> <xsl:for-each-group select="par" group-adjacent="@class='NarrBody'"> <narrative> <xsl:copy-of select="current-group()"/> </narrative> </xsl:for-each-group> </xsl:template> Output: <narrative> <par class="NarrBody">key [ke(long mark over e)] <inline style="font-family: "TimesNewRomanPS Italic";">n.</inline> <inline style="font-weight: bold;">1.</inline> piece of shaped metal used to open or close a lock. <inline style="font- weight: bold;">2.</inline> device for winding toys, clocks, etc. <inline style="font-weight: bold;">3.</inline> important ingredient or element. <inline style="font-weight: bold;">4.</inline> nroup of musical tones.</par> </narrative> <narrative> <par class="stem_mc"> 4.1 What part of speech is the word <inline style="font-style: italic;">key</inline> in this entry?</par> <par class="choice"> A verb</par> <par class="choice"> B noun</par> <par class="choice"> C adjective</par> <par class="choice"> D adverb</par> <par class="Answer">B</par> <par class="g_code">G5U1S9</par> <par class="stem_mc"> 5.1 Which definition of <inline style="font-style: italic;">key</inline> matches how the word is used in the following sentence?</par> <par class="display">What key should I play that in?</par> <par class="choice"> A definition 1</par> <par class="choice"> B definition 2</par> <par class="choice"> C definition 3</par> <par class="choice"> D definition 4</par> <par class="Answer">D</par> <par class="g_code">G5U1S9</par> <par class="NarrIntro">2. Directions: Study the homographs. Then answer the related question(s).</par> </narrative> <narrative> <par class="NarrBody"> <inline style="font-weight: bold;">scale</inline> device for measuring weight</par> <par class="NarrBody"> <inline style="font-weight: bold;">scale</inline> series of steps or degrees </par> <par class="NarrBody"> <inline style="font-weight: bold;">scaln</inline> series of musical notes</par> <par class="NarrBody"> <inline style="font-weight: bold;">scale</inline> outer body layer of fish and snakes</par> </narrative> On Jan 25, 2008, at 5:13 PM, David Carlisle wrote:
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|