xsl-list
[Top] [All Lists]

[xsl] Axis specifier questions once again

2009-11-11 14:26:30
Hi:

I have a nested list like this:

<list1>
<note><para>test</para></note>
  <listlevel>
  sample1
 </listlevel>

<list2>
  <listlevel>
  sample2
 </listlevel>
<list3>

  <listlevel>
sample3
 </listlevel>
</list3>

  <listlevel>
  sample4
 </listlevel>
<list3>

  <listlevel>
  sample5
 </listlevel>
</list3>
  <listlevel>
  sample6
 </listlevel>
<note><para>1 Note</para></note>
<note><para>2 Note</para></note>
<note><para>3 Note</para></note>
</list2>
</list1>

Every listX/listlevel represents a stepX when transformed. StepX is
also a nested list.

So, <list1> would be transformed into <step1><text>sample</text></step1>
<listlevel>
sample
<listlevel>

So in my transformation, the above snippet would transform as follows
with the exception of the last notes where I am having a problem:

<step1>
<note><para>test</para></note>
  <text>
  sample1
</text>
<step2>
    <text>
  sample2
  </text>
<step3>

  <text>
sample3
 </text>
</step3>
</step2>
<step2>
  <text>
  sample4
 </text>
<step3>

  <text>
  sample5
 </text>
</step3>
</step2>
<step2>
  <text>
  sample6
 </text>

<note><para>1 Note</para></note>
<note><para>2 Note</para></note>
<note><para>3 Note</para></note>
</step2>
</step1>

Now, here is my problem. I want the <note> elements at the end of the
last <listlevel> element to come under the last step2 element.

If I use following-sibling::*[self::note], that obviously does not
work because those notes will be displayed even under <step3>.

I am having a hard time coming up with a specific rule for these
<note> elements right under the last listlevel so that theybe
displayed only under that listlevel.

Can anyone please help me here?

Thanks

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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