cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Preceding sibling issue

Former Member
0 Kudos

I've the input xml where i ve tables and notes tags. I need to display the notes which is coming between the tables tags just like that . notes can also come in different places. I've used apply templates of note before table , so its applying all the notes before table itself .I need to display the nodes tag if its coming in between the tables just like that.

INPUT:

<step>
<note>..</note>

<para>..</para>

<table>
 ..
 ..
 </table><note>...</note><table>
   ..
   ..
 </table><table>
   ..
   ..
 </table><note>...</note><text>...</text></step>
desired OUPUT:
<fc:topic>
  <fc:subTask id="S0EC0A941" lbl="E.">
  <fc:para>..</fc:para>
  <fc:text>...</fc:text>
  <fc:note>..</fc:note>
  <fc:table>
   ..
   ..
  </fc:table>
  <fc:note>...</fc:note>
  <fc:table>
   ..
   ..
   </fc:table>
   <fc:table>
   ..
   ..
  </fc:table>
  <fc:note>...</fc:note>
  </fc:subTask>
 </fc:topic>

Current XSLT which needs to modify for the desired output 
<xsl:template match="step">
    <fc:topic>
        <fc:subTask>
            <xsl:if test="@id">
                <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
            </xsl:if>
            <xsl:attribute name="lbl"><xsl:number format="A."/></xsl:attribute>         
            <xsl:apply-templates select="para"/>
            <xsl:apply-templates select="text"/>
            <xsl:apply-templates select="note"/>
            <xsl:apply-templates select="table"/>               
        </fc:subTask>
    </fc:topic>
</xsl:template>

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190293
Active Contributor
0 Kudos

Hi Aswini!

<xsl:apply-templates select="table/note"/>

Regards, Evgeniy.