Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2783

FOP fails to generate pdf for certain URLS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.2
    • None
    • fo/page
    • None

    Description

       I have an issue with generating pdf files using the apache fop tool from url based data, whenever there are certain characters or keywords such as utm or rel as the below given url

      For example : 

      https://www.youtube.com/embed/1mDT-x2XnEg?autoplay=1&rel=0&feature=oembed&enablejsapi=1&wmode=opaque

       

      I get the following error

      SEVERE: Exception org.apache.fop.apps.FOPException: The reference to entity "rel" must end with the ';' delimiter. javax.xml.transform.TransformerException: The reference to entity "rel" must end with the ';' delimiter.

       

       

      My XML DATA FILE - mytest.xml contains:

      <url>https://www.youtube.com/embed/1mDT-x2XnEg?autoplay=1&rel=0&feature=oembed&enablejsapi=1&wmode=opaque</url>

       

      My XSL TEMPLATE FILE - mytest.xsl contains

       

      <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="A4-portrait" page-height="29.7cm" page-width="21.0cm" margin="2cm"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4-portrait">

      <fo:flow flow-name="xsl-region-body">

      <fo:block> <fo:basic-link external-destination="url({url/@href})" color="blue" text-decoration="underline"> <xsl:value-of select="url/@href"/> </fo:basic-link> </fo:block> </fo:flow> </fo:page-sequence>  </fo:root>

       </xsl:template>

      </xsl:stylesheet>{{}}

       

      Tested using bash commandline:

      myvar=mytest && /opt/fop-2.2/fop/fop -r -v -xml $myvar.xml -xsl $myvar.xsl -pdf $myvar.pdf }}{{

      PDF generation fails ..generating using fop v2.2 on kali linux 2018 and opensuse 42.3

       

       

      I have tried both encodings - UTF-8 and  encoding="ISO-8859-1" ...still no luck. Any help will be appreciated here.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            magnusmel magnus melwin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: