[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Axis specifier questions once again


Subject: [xsl] Axis specifier questions once again
From: a kusa <akusa8@xxxxxxxxx>
Date: Wed, 11 Nov 2009 13:26:00 -0600

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


Current Thread