|
Subject: [xsl] enclosing siblings in an element From: Terry Ofner <tofner@xxxxxxxxxxx> Date: Wed, 23 Jan 2008 17:26:33 -0500 |
I am a bit stuck on this one. After converting a Word document to rtf
and using upCast I end up with a "flat" structure such as this:
<document>
<part>
<par class="stem_mc">	1	Read the sentence. Then choose the
best synonym to replace the boldfaced word.</par>
<par class="display">The threat of rain makes it <inline
style="font-weight: bold;">dubious</inline> that the game will go on
as scheduled.</par>
<par class="choice-a">	A	doubtful</par>
<par class="choice-b">	B	likely</par>
<par class="choice-c">	C	hopeful</par>
<par class="choice-d">	D	obvious</par>
<par class="Answer">A</par>
<par class="g_code">G5U1S5</par> <par class="stem_mc">	2	As used in the sentence below,
what is the denotation of the word <inline style="font-style:
italic;">mutt?</inline></par>
<par class="display">What is that mutt doing in our yard?
asked Dad.</par>
<par class="choice-a">	A	animal</par>
<par class="choice-b">	B	dog </par>
<par class="choice-c">	C	creature</par>
<par class="choice-d">	D	pet</par>
<par class="Answer">B</par>
<par class="g_code">G5U1S8</par> <par class="stem_sa">	3	Describe the connotation of the
word <inline style="font-style: italic;">mutt</inline> and explain
wheeher it is positive or negative. </par>
<par class="Answer"><inline style="font-style: italic;"><target
id="OLE_LINK1" /><target id="OLE_LINK2" />Answers will vary. Possible
answer:</inline> The word <inline style="font-style: italic;">mutt</
inline> has the negative connotation of a dog that isnt worth very
much or that isnt good-looking.<endtarget id="OLE_LINK1" /
><endtarget id="OLE_LINK2" /></par>
<par class="g_code">G5U1S8</par>
<--much more like this--></part> </document>
My goal is the wrap each question in a question element:
<question>
<par class="stem_mc">	1	Read the sentence. Then choose the best
synonym to replace the boldfaced word.</par>
<par class="display">The threat of rain makes it <inline
style="font-weight: bold;">dubious</inline> that the game will go on
as scheduled.</par>
<par class="choice-a">	A	doubtful</par>
<par class="choice-b">	B	likely</par>
<par class="choice-c">	C	hopeful</par>
<par class="choice-d">	D	obvious</par>
<par class="Answer">A</par>
<par class="g_code">G5U1S5</par>
</question>
<question>
<par class="stem_mc">	2	As used in the sentence below,
what is the denotation of the word <inline style="font-style:
italic;">mutt?</inline></par>
<par class="display">What is that mutt doing in our yard?
asked Dad.</par>
<par class="choice-a">	A	animal</par>
<par class="choice-b">	B	dog </par>
<par class="choice-c">	C	creature</par>
<par class="choice-d">	D	pet</par>
<par class="Answer">B</par>
<par class="g_code">G5U1S8</par>
</question>
<question>
<par class="stem_sa">	3	Describe the connotation of the word
<inline style="font-style: italic;">mutt</inline> and explain wheeher
it is positive or negative. </par>
<par class="Answer"><inline style="font-style: italic;"><target
id="OLE_LINK1" /><target id="OLE_LINK2" />Answers will vary. Possible
answer:</inline> The word <inline style="font-style: italic;">mutt</
inline> has the negative connotation of a dog that isnt worth very
much or that isnt good-looking.<endtarget id="OLE_LINK1" /
><endtarget id="OLE_LINK2" /></par>
<par class="g_code">G5U1S8</par>
</question>Notice that each question starts with a stem attribute and is anchored with a g_code attribute. But there can be various <par> elements between. Is there an easy way to "select" all the <par> elements between two <par> elements?
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] unparsed-text and analyze, David Carlisle | Thread | RE: [xsl] enclosing siblings in an , Scott Trenda |
| Re: [xsl] unfolding compressed equi, Robert Koberg | Date | Re: [xsl] unfolding compressed equi, David Carlisle |
| Month |