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

Trouble with XSL in FO only - keys? external doc? not sure what the problem is...

Expand Messages
  • Dahlquist_Michael/shure@shure.com
    Hi - This may well be an XSL problem, but it only shows itself when I transform FO to PDF. I m using Cocoon for all my transformations. Going to XML or HTML
    Message 1 of 7 , Dec 2, 2002
    • 0 Attachment
      Hi -

      This may well be an XSL problem, but it only shows itself when I
      transform FO to PDF. I'm using Cocoon for all my transformations. Going
      to XML or HTML works fine; to PDF, including the following text
      produces no PDF file, and the error "FOPException: root must be root
      element."

      I've stripped both HTML and PDF output down to find the problem, but so
      far I haven't been successful. This is the XSL for HTML output:

      <xsl:template match="ACCESSORIES">
      <p class="subhead">ACCESSORIES</p>
      <xsl:apply-templates select="$partLookupDoc"/>
      <xsl:if test="FURNISHED">
      <p class="spec_head">FURNISHED</p>
      <p class="spec"><xsl:apply-templates/></p>
      </xsl:if>
      <xsl:if test="REPLACEMENT">
      <p class="spec_head">REPLACEMENT</p>
      <p class="spec"><xsl:apply-templates/></p>
      </xsl:if>
      <xsl:if test="OPTIONAL">
      <p class="spec_head">OPTIONAL</p>
      <p class="spec"><xsl:apply-templates/></p>
      </xsl:if>
      </xsl:template>

      ...and this is for PDF output:

      <xsl:template match="ACCESSORIES">
      <fo:block xsl:use-attribute-sets="subhead">ACCESSORIES</fo:block>
      <xsl:apply-templates select="$partLookupDoc"/>
      <xsl:if test="FURNISHED">
      <fo:block
      xsl:use-attribute-sets="spec_head">FURNISHED</fo:block>
      <fo:block
      xsl:use-attribute-sets="spec"><xsl:apply-templates/></fo:block>
      </xsl:if>
      <xsl:if test="REPLACEMENT">
      <fo:block
      xsl:use-attribute-sets="spec_head">REPLACEMENT</fo:block>
      <fo:block
      xsl:use-attribute-sets="spec"><xsl:apply-templates/></fo:block>
      </xsl:if>
      <xsl:if test="OPTIONAL">
      <fo:block
      xsl:use-attribute-sets="spec_head">OPTIONAL</fo:block>
      <fo:block
      xsl:use-attribute-sets="spec"><xsl:apply-templates/></fo:block>
      </xsl:if>
      </xsl:template>

      Any clues as to why this might work in HTML and XML, but not in PDF?

      Thanks in advance for any advice -

      Michael
    • Oleg Tkachenko
      ... Yes, it looks like xsl problem, you FO is probably non valid. ... They re completely different beasts. xml+xsl- html xml+xsl- fo- FOP- pdf FOP doesn t like
      Message 2 of 7 , Dec 2, 2002
      • 0 Attachment
        Dahlquist_Michael/shure@... wrote:

        > This may well be an XSL problem, but it only shows itself when I
        > transform FO to PDF.
        Yes, it looks like xsl problem, you FO is probably non valid.

        > Any clues as to why this might work in HTML and XML, but not in PDF?
        They're completely different beasts.
        xml+xsl->html
        xml+xsl->fo->FOP->pdf
        FOP doesn't like your FO, make sure it's ok and root element is fo:root.

        --
        Oleg Tkachenko
        eXperanto team
        Multiconn Technologies, Israel
      • Dahlquist_Michael/shure@shure.com
        ... The FO is valid - and now I ve traced the problem a little better. If I comment out this line: ...from the
        Message 3 of 7 , Dec 2, 2002
        • 0 Attachment
          >Yes, it looks like xsl problem, you FO is probably non valid.

          The FO is valid - and now I've traced the problem a little better. If I
          comment out this line:

          <xsl:apply-templates select="$partLookupDoc"/>

          ...from the FO, the transform works fine.

          If I take out the variable and include a hard link to the external
          document, the transform fails as well. Again, any other XML transform
          has no problem with this line.

          Does FOP not like external documents?



          -----Original Message-----
          From: olegt [mailto:olegt@...]
          Sent: Monday, December 02, 2002 1:30 PM
          To: XSL-FO
          Cc: olegt
          Subject: Re: [XSL-FO] Trouble with XSL in FO only - keys? external doc?
          not sure what the problem is...


          Dahlquist_Michael/shure@... wrote:

          > This may well be an XSL problem, but it only shows itself when I
          > transform FO to PDF.
          Yes, it looks like xsl problem, you FO is probably non valid.

          > Any clues as to why this might work in HTML and XML, but not in PDF?
          They're completely different beasts.
          xml+xsl->html
          xml+xsl->fo->FOP->pdf
          FOP doesn't like your FO, make sure it's ok and root element is fo:root.

          --
          Oleg Tkachenko
          eXperanto team
          Multiconn Technologies, Israel


          To unsubscribe from this group, send an email to:
          XSL-FO-unsubscribe@egroups.com



          Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
        • Oleg Tkachenko
          ... And how does it affect resulting FO? It s rather unclear what do you mean. Post small example of resulting FO. ... FOP has nothing to do with any external
          Message 4 of 7 , Dec 2, 2002
          • 0 Attachment
            Dahlquist_Michael/shure@... wrote:

            > The FO is valid - and now I've traced the problem a little better. If I
            > comment out this line:
            >
            > <xsl:apply-templates select="$partLookupDoc"/>
            And how does it affect resulting FO? It's rather unclear what do you
            mean. Post small example of resulting FO.

            > Does FOP not like external documents?
            FOP has nothing to do with any external documents, it's just FO
            formatter. You must generate valid FO document for FOP.

            --
            Oleg Tkachenko
            eXperanto team
            Multiconn Technologies, Israel
          • Dahlquist_Michael/shure@shure.com
            ... I m showing my true colors here, please accept my apologies; but I m not sure what this means. I ve only created FO stylesheets manually, and generated PDF
            Message 5 of 7 , Dec 2, 2002
            • 0 Attachment
              >And how does it affect resulting FO?

              I'm showing my true colors here, please accept my apologies; but I'm
              not sure what this means.

              I've only created FO stylesheets manually, and generated PDF files
              directly from these stylesheets. I'm not sure how to get at the
              "resulting FO;" I only know how to create the PDF file.

              Using FOP/Cocoon, how do I view the result from an FO transform?
            • Jim White
              ... I use a set of maps like this:
              Message 6 of 7 , Dec 2, 2002
              • 0 Attachment
                Dahlquist_Michael/shure@... wrote:
                >>And how does it affect resulting FO?
                >...
                > Using FOP/Cocoon, how do I view the result from an FO transform?

                I use a set of maps like this:

                <map:match pattern="report.html">
                <map:generate src="data.xml"/>
                <map:transform src="stylesheets/report.xsl"/>
                <map:serialize type="xhtml"/>
                </map:match>

                <map:match pattern="report.fo">
                <map:generate src="data.xml"/>
                <map:transform src="stylesheets/report.xsl"/>
                <map:transform src="stylesheets/xhtml2fo.xsl"/>
                <map:serialize type="xhtml"/>
                </map:match>

                <map:match pattern="report.pdf">
                <map:generate src="data.xml"/>
                <map:transform src="stylesheets/report.xsl"/>
                <map:transform src="stylesheets/xhtml2fo.xsl"/>
                <map:serialize type="fo2pdf"/>
                </map:match>

                Jim
              • Oleg Tkachenko
                ... Ok, then post this FO stylesheet (I think you have meant xsl stylesheet, right?) -- Oleg Tkachenko eXperanto team Multiconn Technologies, Israel
                Message 7 of 7 , Dec 3, 2002
                • 0 Attachment
                  Dahlquist_Michael/shure@... wrote:

                  > I've only created FO stylesheets manually, and generated PDF files
                  > directly from these stylesheets. I'm not sure how to get at the
                  > "resulting FO;" I only know how to create the PDF file.
                  Ok, then post this FO stylesheet (I think you have meant xsl stylesheet, right?)

                  --
                  Oleg Tkachenko
                  eXperanto team
                  Multiconn Technologies, Israel
                Your message has been successfully submitted and would be delivered to recipients shortly.