You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Luca Mambretti (JIRA)" <ji...@apache.org> on 2018/04/16 07:49:00 UTC

[jira] [Comment Edited] (FOP-2783) FOP fails to generate pdf for certain URLS

    [ https://issues.apache.org/jira/browse/FOP-2783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439084#comment-16439084 ] 

Luca Mambretti edited comment on FOP-2783 at 4/16/18 7:48 AM:
--------------------------------------------------------------

To me this looks more like a source XML problem than a real FOP problem, try wrapping your URL in a CDATA block and it will most probably fix your issue.

 

something like this should work:

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


was (Author: irian):
To me this looks more like a source XML problem than a real FOP problem, try wrapping your URL in a CDATA block and it will most probably fix your issue.

 

something like this should work:

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

> FOP fails to generate pdf for certain URLS
> ------------------------------------------
>
>                 Key: FOP-2783
>                 URL: https://issues.apache.org/jira/browse/FOP-2783
>             Project: FOP
>          Issue Type: Bug
>          Components: fo/page
>    Affects Versions: 2.2
>            Reporter: magnus melwin
>            Priority: Major
>
>  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.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)