Loading ...
Sorry, an error occurred while loading the content.

7385Question about order of elements in xslfo

Expand Messages
  • mina_hurray
    May 1, 2007
    • 0 Attachment
      Hi:

      I have an xml input file as shown below:

      <mfunc>
      <text><para></para></text>

      <image><title></title></image>
      <table></table>
      <text><para></para></text>
      <text><para></para></text>
      <image><title></title></image>

      <l1>
      .....
      </l1>

      <image><title></title></image>
      <table></table>
      <text><para></para></text>

      </mfunc>


      As you can see elements image, table and text can appear before and
      after <l1>. Now in the PDF, I want all image, text and table elements
      to appear before l1 and the ones after to appear after l1.

      Here is my XSLFO piece for tjis part:

      <xsl:choose>
      <xsl:when test="*[self::image[following-sibling::table] or
      self::image[following-sibling::text] or self::image]">
      <xsl:apply-templates select="*[not(self::image) and
      not(self::table[preceding::image]) and
      not(self::text[preceding::image])]"/>
      </xsl:when>
      <xsl:otherwise>
      <xsl:apply-templates/>
      </xsl:otherwise>
      </xsl:choose>


      The issue I am facing here is:

      1) becos of "<xsl:apply-templates select="*[not(self::image)...."
      Any image that appears before <l1> is forced to the end after l1.

      2) The same holds true for text and table elements.

      Can anyone suggest a different apprach to this problem?

      Thanks in advance for your help.
    • Show all 3 messages in this topic