FOP module

Tuesday, 8 December 2020 · 10 messages · last reply 7 Jan 2021
JC
Jerome Chauveau8 Dec 2020 15:09 #
Hi, I am trying to use the (too old ?) FOP module, but unsuccessfully. I copied that example :
import module namespace fop = 'org.basex.modules.fop.FOP';
let $xsl := xslt:transform('fop.xml', 'fop.xsl')
let $pdf := fop:transform($xsl)
return file:write-binary('fop.pdf', $pdf)
from this thead : [ https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html | https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html ] which generates that error (in a BaseX 9.3) : [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). Any suggestions on how to fix this ? Thanks Regards Jérôme
CG
Christian Grün11 Dec 2020 16:50 #
Hi Jérôme, I just learned there are some more modules (such as the FTP Module) that need to be aligned with the latest version of BaseX. I hope we’ll manage to look at that next week. Merci et salutations Christian
Quoted text · Jerome Chauveau · 31 lines
On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > I copied that example : > > import module namespace fop = 'org.basex.modules.fop.FOP'; > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > let $pdf := fop:transform($xsl) > return file:write-binary('fop.pdf', $pdf) > > > from this thead : https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > which generates that error (in a BaseX 9.3) : > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > Any suggestions on how to fix this ? > Thanks > > Regards > > > Jérôme > > >
AB
Andy Bunce12 Dec 2020 16:17 #
I am sure it is already on your list but just in case... There are some map:new references that need to be map:merge in https://files.basex.org/modules/org/basex/modules/map-extras.xqm /Andy
Quoted text · Christian Grün · 48 lines
On Fri, 11 Dec 2020 at 15:50, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Jérôme, > > I just learned there are some more modules (such as the FTP Module) > that need to be aligned with the latest version of BaseX. I hope we’ll > manage to look at that next week. > > Merci et salutations > Christian > > > > On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau > <jerome.chauveau at unicaen.fr> wrote: > > > > Hi, > > > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > > I copied that example : > > > > import module namespace fop = 'org.basex.modules.fop.FOP'; > > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > > let $pdf := fop:transform($xsl) > > return file:write-binary('fop.pdf', $pdf) > > > > > > from this thead : > https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > > > which generates that error (in a BaseX 9.3) : > > > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private > method 'void org.basex.query.value.item.B64.<init>(byte[])' > > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in > unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > > > Any suggestions on how to fix this ? > > Thanks > > > > Regards > > > > > > Jérôme > > > > > > >
CG
Christian Grün12 Dec 2020 16:48 #
Thanks Andy.
Quoted text · Andy Bunce · 57 lines
Andy Bunce <bunce.andy at gmail.com> schrieb am Sa., 12. Dez. 2020, 16:17: > I am sure it is already on your list but just in case... > There are some map:new references that need to be map:merge in > https://files.basex.org/modules/org/basex/modules/map-extras.xqm > > /Andy > > On Fri, 11 Dec 2020 at 15:50, Christian Grün <christian.gruen at gmail.com> > wrote: > >> Hi Jérôme, >> >> I just learned there are some more modules (such as the FTP Module) >> that need to be aligned with the latest version of BaseX. I hope we’ll >> manage to look at that next week. >> >> Merci et salutations >> Christian >> >> >> >> On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau >> <jerome.chauveau at unicaen.fr> wrote: >> > >> > Hi, >> > >> > I am trying to use the (too old ?) FOP module, but unsuccessfully. >> > I copied that example : >> > >> > import module namespace fop = 'org.basex.modules.fop.FOP'; >> > let $xsl := xslt:transform('fop.xml', 'fop.xsl') >> > let $pdf := fop:transform($xsl) >> > return file:write-binary('fop.pdf', $pdf) >> > >> > >> > from this thead : >> https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html >> > >> > which generates that error (in a BaseX 9.3) : >> > >> > [XPTY0004] class org.basex.modules.fop.FOP tried to access private >> method 'void org.basex.query.value.item.B64.<init>(byte[])' >> > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in >> unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). >> > >> > Any suggestions on how to fix this ? >> > Thanks >> > >> > Regards >> > >> > >> > Jérôme >> > >> > >> > >> >
CG
Christian Grünin reply to Jerome Chauveau, 8 Dec 2020, 15:0915 Dec 2020 14:35 #
Hi Jérôme, hi Andy, We have aligned all modules with the latest version of BaseX (including the FOP, FTP and Map module). Hope this helps, Christian
Quoted text · Jerome Chauveau · 31 lines
On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > I copied that example : > > import module namespace fop = 'org.basex.modules.fop.FOP'; > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > let $pdf := fop:transform($xsl) > return file:write-binary('fop.pdf', $pdf) > > > from this thead : https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > which generates that error (in a BaseX 9.3) : > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > Any suggestions on how to fix this ? > Thanks > > Regards > > > Jérôme > > >
JC
Jerome Chauveau16 Dec 2020 09:39 #
Thanks a lot Christian ! Jérôme ----- Mail original -----
Quoted text · Christian Grün · 41 lines
De: "Christian Grün" <christian.gruen at gmail.com> À: "jerome chauveau" <jerome.chauveau at unicaen.fr>, "Andy Bunce" <bunce.andy at gmail.com> Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> Envoyé: Mardi 15 Décembre 2020 14:35:28 Objet: Re: [basex-talk] FOP module Hi Jérôme, hi Andy, We have aligned all modules with the latest version of BaseX (including the FOP, FTP and Map module). Hope this helps, Christian On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > I copied that example : > > import module namespace fop = 'org.basex.modules.fop.FOP'; > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > let $pdf := fop:transform($xsl) > return file:write-binary('fop.pdf', $pdf) > > > from this thead : https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > which generates that error (in a BaseX 9.3) : > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > Any suggestions on how to fix this ? > Thanks > > Regards > > > Jérôme > > >
JC
Jerome Chauveau5 Jan 2021 12:51 #
Hi, I am now trying to use custom fonts with the FOP module. Has anyone ever tried such a thing ? FOP can take a config file as parameter where fonts configuration can be specified. I might be wrong but according to the Fop.transform function's signature, this feature seems to be unavailable through the BaseX module. Should I modify (based on https://xmlgraphics.apache.org/fop/1.1/embedding.html#config-external) and recompile the module ? Thanks Regards, Jérôme ----- Mail original -----
Quoted text · jerome chauveau · 49 lines
De: "jerome chauveau" <jerome.chauveau at unicaen.fr> À: "Christian Grün" <christian.gruen at gmail.com> Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> Envoyé: Mercredi 16 Décembre 2020 09:39:22 Objet: Re: [basex-talk] FOP module Thanks a lot Christian ! Jérôme ----- Mail original ----- De: "Christian Grün" <christian.gruen at gmail.com> À: "jerome chauveau" <jerome.chauveau at unicaen.fr>, "Andy Bunce" <bunce.andy at gmail.com> Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> Envoyé: Mardi 15 Décembre 2020 14:35:28 Objet: Re: [basex-talk] FOP module Hi Jérôme, hi Andy, We have aligned all modules with the latest version of BaseX (including the FOP, FTP and Map module). Hope this helps, Christian On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > I copied that example : > > import module namespace fop = 'org.basex.modules.fop.FOP'; > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > let $pdf := fop:transform($xsl) > return file:write-binary('fop.pdf', $pdf) > > > from this thead : https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > which generates that error (in a BaseX 9.3) : > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > Any suggestions on how to fix this ? > Thanks > > Regards > > > Jérôme > > >
CG
Christian Grün5 Jan 2021 12:59 #
Hi Jérôme, Yes, please feel free to extend the existing FOP module. Inside the JAR file you’ll find the original FOP.java file. Looking forward to hearing more about your experiences, Christian
Quoted text · Jerome Chauveau · 80 lines
On Tue, Jan 5, 2021 at 12:51 PM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am now trying to use custom fonts with the FOP module. > > Has anyone ever tried such a thing ? > > FOP can take a config file as parameter where fonts configuration can be specified. I might be wrong but according to the Fop.transform function's signature, this feature seems to be unavailable through the BaseX module. > > Should I modify (based on https://xmlgraphics.apache.org/fop/1.1/embedding.html#config-external) and recompile the module ? > > Thanks > > Regards, > > Jérôme > > ----- Mail original ----- > De: "jerome chauveau" <jerome.chauveau at unicaen.fr> > À: "Christian Grün" <christian.gruen at gmail.com> > Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> > Envoyé: Mercredi 16 Décembre 2020 09:39:22 > Objet: Re: [basex-talk] FOP module > > Thanks a lot Christian ! > > > Jérôme > ----- Mail original ----- > De: "Christian Grün" <christian.gruen at gmail.com> > À: "jerome chauveau" <jerome.chauveau at unicaen.fr>, "Andy Bunce" <bunce.andy at gmail.com> > Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> > Envoyé: Mardi 15 Décembre 2020 14:35:28 > Objet: Re: [basex-talk] FOP module > > Hi Jérôme, hi Andy, > > We have aligned all modules with the latest version of BaseX > (including the FOP, FTP and Map module). > > Hope this helps, > Christian > > > > On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau > <jerome.chauveau at unicaen.fr> wrote: > > > > Hi, > > > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > > I copied that example : > > > > import module namespace fop = 'org.basex.modules.fop.FOP'; > > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > > let $pdf := fop:transform($xsl) > > return file:write-binary('fop.pdf', $pdf) > > > > > > from this thead : https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > > > which generates that error (in a BaseX 9.3) : > > > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' > > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > > > Any suggestions on how to fix this ? > > Thanks > > > > Regards > > > > > > Jérôme > > > > > > > >
JC
Jerome Chauveau5 Jan 2021 16:59 #
Hi, I added these few lines to the FOP class :
[...]
File cf = new File("fop.xconf");
if(cf.exists())
   ff.setUserConfig(cf);
[...]
it works like a charm with a fop.xconf (which contains fonts'config) file in the basex root dir. Do you plan to upgrade the FOP dependency ? Is your module available through a git repo ? My extend procedure is a bit dirty and not easily maintainable. Thank you ! Jérôme ----- Mail original -----
Quoted text · Christian Grün · 90 lines
De: "Christian Grün" <christian.gruen at gmail.com> À: "jerome chauveau" <jerome.chauveau at unicaen.fr> Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> Envoyé: Mardi 5 Janvier 2021 12:59:22 Objet: Re: [basex-talk] FOP module Hi Jérôme, Yes, please feel free to extend the existing FOP module. Inside the JAR file you’ll find the original FOP.java file. Looking forward to hearing more about your experiences, Christian On Tue, Jan 5, 2021 at 12:51 PM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am now trying to use custom fonts with the FOP module. > > Has anyone ever tried such a thing ? > > FOP can take a config file as parameter where fonts configuration can be specified. I might be wrong but according to the Fop.transform function's signature, this feature seems to be unavailable through the BaseX module. > > Should I modify (based on https://xmlgraphics.apache.org/fop/1.1/embedding.html#config-external) and recompile the module ? > > Thanks > > Regards, > > Jérôme > > ----- Mail original ----- > De: "jerome chauveau" <jerome.chauveau at unicaen.fr> > À: "Christian Grün" <christian.gruen at gmail.com> > Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> > Envoyé: Mercredi 16 Décembre 2020 09:39:22 > Objet: Re: [basex-talk] FOP module > > Thanks a lot Christian ! > > > Jérôme > ----- Mail original ----- > De: "Christian Grün" <christian.gruen at gmail.com> > À: "jerome chauveau" <jerome.chauveau at unicaen.fr>, "Andy Bunce" <bunce.andy at gmail.com> > Cc: "basex-talk" <basex-talk at mailman.uni-konstanz.de> > Envoyé: Mardi 15 Décembre 2020 14:35:28 > Objet: Re: [basex-talk] FOP module > > Hi Jérôme, hi Andy, > > We have aligned all modules with the latest version of BaseX > (including the FOP, FTP and Map module). > > Hope this helps, > Christian > > > > On Tue, Dec 8, 2020 at 3:09 PM Jerome Chauveau > <jerome.chauveau at unicaen.fr> wrote: > > > > Hi, > > > > I am trying to use the (too old ?) FOP module, but unsuccessfully. > > I copied that example : > > > > import module namespace fop = 'org.basex.modules.fop.FOP'; > > let $xsl := xslt:transform('fop.xml', 'fop.xsl') > > let $pdf := fop:transform($xsl) > > return file:write-binary('fop.pdf', $pdf) > > > > > > from this thead : https://mailman.uni-konstanz.de/pipermail/basex-talk/2014-February/006326.html > > > > which generates that error (in a BaseX 9.3) : > > > > [XPTY0004] class org.basex.modules.fop.FOP tried to access private method 'void org.basex.query.value.item.B64.<init>(byte[])' > > (org.basex.modules.fop.FOP and org.basex.query.value.item.B64 are in unnamed module of loader 'app'). Caused by: FOP:transform(document-node()). > > > > Any suggestions on how to fix this ? > > Thanks > > > > Regards > > > > > > Jérôme > > > > > > > >
CG
Christian Grün7 Jan 2021 13:22 #
Quoted text · Jerome Chauveau · 1 line
> it works like a charm with a fop.xconf (which contains fonts'config) file in the basex root dir.
Glad to hear that!
Quoted text · Jerome Chauveau · 1 line
> Do you plan to upgrade the FOP dependency ?
Currently no, but we’ll let you know. In the long term, we’d like to have a public repository page for all modules with some documentation added.

⚡Generated with XQuery