XSL-FO assistance

View: New views
16 Messages — Rating Filter:   Alert me  

XSL-FO assistance

by Ethan Aho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using eXist 1.1.2dev (revision 4311).  I have succeeded in getting
data from MSSQL and MySQL into eXist and have had some success with XSLT.

I need help with XSL-FO, though.  I went into conf.xml and added in the
module there.  But I have not been successful finding examples,
available functions, etc.  I have the test xml, xsl, and fo from
http://www.xmlmind.com/foconverter/how_it_works.html but have no idea
how to get the .fo to work in eXist.  Do I need to download anything
(like I did for the SQL module)?

Can one you guys with big brains please point me in the right direction?

thank you,
Ethan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Wed, May 14, 2008 at 5:47 PM, Ethan Aho <eaho@...> wrote:
> I'm using eXist 1.1.2dev (revision 4311).

Hmmmmmm 1.1.x branche has been terminated some time ago, the code
landed as 1.2 and is considered stable now, for quite some time. I'd
like to suggest you to upgrade to 1.2.1 (will be released soon...
days). Since 4311 we have had +- 3000 revisions, containing
extensions, fixes, etc,

> But I have not been successful finding examples,
> available functions, etc.

exist provides a dynamically generated page containing detailed
descriptions (kind of) of all functions of all modules. If the
module/functions are not listed there you'll need to recheck conf.xml

I think some of the documentation got lost during our wiki-crash...

regards

Dannes

--
# Dannes Wessels # The Netherlands #

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Ethan Aho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My apologies.  I am using eXist-setup-1.2.0-rev7233.jar

As for
"exist provides a dynamically generated page containing detailed
descriptions (kind of) of all functions of all modules. If the
module/functions are not listed there you'll need to recheck conf.xml I
think some of the documentation got lost during our wiki-crash..."

My conf.xml has XSLFOModule module uncommented, but nothing shows in the functions page.  My SQL module works, but never showed up in my functions list either.  Luckily there are documents on how to use SQL with eXist.  I have not been able to find the functions online either (or examples).  All I've been able to determine is that FOP is supported in eXist.


Ethan


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Pierrick Brihaye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Ethan Aho a écrit :

> My conf.xml has XSLFOModule module uncommented, but nothing shows in
> the functions page.  My SQL module works, but never showed up in my
> functions list either.  Luckily there are documents on how to use SQL
> with eXist.  I have not been able to find the functions online either
> (or examples).

So, they are most likely not correctly plugged.

>  All I've been able to determine is that FOP is
> supported in eXist.

The FOP module's source code has a readme.txt. Not very verbose, but it
could be a start.

Also, as usual, analyzing the logs may help in getting the picture.

Cheers,

p.b.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Wed, May 14, 2008 at 7:52 PM, Pierrick Brihaye
<pierrick.brihaye@...> wrote:
>> My conf.xml has XSLFOModule module uncommented, but nothing shows in
>> the functions page.  My SQL module works, but never showed up in my
>> functions list either.  Luckily there are documents on how to use SQL
>> with eXist.  I have not been able to find the functions online either
>> (or examples).

ah right. probably the documentation needs to be regenerated first ;
first remove the collection /db/xqdocs

regards

Dannes

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Ethan Aho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dannes,

The function rebuild brought up the SQL module functions, but not the
XLSFO functions.  I did look at the readme.txt of the module itself and
have the jar files in place.  I'm not having much luck figuring out
functions and their parameters from reading through code, though.  And
since http://demo.exist-db.org/xquery/functions.xq doesn't have the
functions either, I'm at a loss of what to try.

Ethan


Dannes Wessels wrote:

> Hi,
>
> On Wed, May 14, 2008 at 7:52 PM, Pierrick Brihaye
> <pierrick.brihaye@...> wrote:
>  
>>> My conf.xml has XSLFOModule module uncommented, but nothing shows in
>>> the functions page.  My SQL module works, but never showed up in my
>>> functions list either.  Luckily there are documents on how to use SQL
>>> with eXist.  I have not been able to find the functions online either
>>> (or examples).
>>>      
>
> ah right. probably the documentation needs to be regenerated first ;
> first remove the collection /db/xqdocs
>
> regards
>
> Dannes
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Exist-open mailing list
> Exist-open@...
> https://lists.sourceforge.net/lists/listinfo/exist-open
>  

--
Ethan Aho
Database Administrator
Kennedy Information
(603) 924-0900 ext 611


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Function details are -

xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary

Renders a given XSL-FO document. $a is the XSL-FO node, $b is the
required mime-type, $c is parameters to the transformation.
Returns an xs:base64binary of the result.
Parameters are specified with the structure:
<parameters><param name="param-name1" value="param-value1"/>
</parameters>
Recognised rendering parameters are: author, title.

http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xslfo/readme.txt?view=markup

I am not sure why this is not appearing in the functions page if it is
compiled and enabled, someone also reported the same problem with the
SQLModule?!? I wonder whats going on here?

Thanks Adam.

2008/5/14 Ethan Aho <eaho@...>:

> Dannes,
>
> The function rebuild brought up the SQL module functions, but not the
> XLSFO functions.  I did look at the readme.txt of the module itself and
> have the jar files in place.  I'm not having much luck figuring out
> functions and their parameters from reading through code, though.  And
> since http://demo.exist-db.org/xquery/functions.xq doesn't have the
> functions either, I'm at a loss of what to try.
>
> Ethan
>
>
> Dannes Wessels wrote:
>> Hi,
>>
>> On Wed, May 14, 2008 at 7:52 PM, Pierrick Brihaye
>> <pierrick.brihaye@...> wrote:
>>
>>>> My conf.xml has XSLFOModule module uncommented, but nothing shows in
>>>> the functions page.  My SQL module works, but never showed up in my
>>>> functions list either.  Luckily there are documents on how to use SQL
>>>> with eXist.  I have not been able to find the functions online either
>>>> (or examples).
>>>>
>>
>> ah right. probably the documentation needs to be regenerated first ;
>> first remove the collection /db/xqdocs
>>
>> regards
>>
>> Dannes
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Exist-open mailing list
>> Exist-open@...
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>
> --
> Ethan Aho
> Database Administrator
> Kennedy Information
> (603) 924-0900 ext 611
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Exist-open mailing list
> Exist-open@...
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Wolfgang Meier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I am not sure why this is not appearing in the functions page if it is
> compiled and enabled, someone also reported the same problem with the
> SQLModule?!? I wonder whats going on here?

I'm not so sure if it is compiled. Did you change
extensions/modules/build.properties? You need to set

include.module.xslfo = true

otherwise the module will be skipped.

Wolfgang

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Ethan Aho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have succeeded in getting the SQL module working (and functions
visible).  I'm using eXist 1.2ish.

In my attempts to get XSL-FO working, I have:
* un-commented the lines needed in conf.xml
* include.module.xslfo = true has been set in
extensions/modules/build.properties
* looked at the readme.txt and added the needed 3 jar files
* restarted eXist
* rebooted the server it runs on
* deleted /db/xqdocs, then regenerated them in the functions section

The results are:
* No XSLFO functions are visible in the functions list.
* The below test.xql returns "Call to undeclared function: xslfo:render
[at line 8, column 16]"
**  I had tried 'utf8', 'utf-8', '', () for parameter B

Here's the test xql to run a simple fo document
----------------------------------------------------------------------
xquery version "1.0";
declare namespace xslfo="http://exist-db.org/xquery/xslfo";
declare variable $fo_doc :=
doc('/db/kennedyInformation/scratch/eaho/fo_test/fotest.fo');
let $render := xslfo:render($fo_doc, "utf8", "<parameters/>")
return $render
----------------------------------------------------------------------

Here's what shows up in my log file when I try to run the xql through rest
----------------------------------------------------------------------
2008-05-15 09:30:12,162 [P1-9] DEBUG (HttpConnection.java [<init>]:115)
- new HttpConnection: Socket[addr=/10.100.2.11,port=4768,localport=8080]
2008-05-15 09:30:12,163 [P1-9] DEBUG (HttpConnection.java
[handleNext]:978) - REQUEST from P1@...:8080:
GET /exist/rest/db/kennedyInformation/scratch/eaho/fo_test/renderfo.xq
HTTP/1.1
Host: porkins:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)
Gecko/20080404 Firefox/2.0.0.14
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive: 300
Connection: keep-alive
Cookie: JSESSIONID=1kzu6hv2l9eq
Cache-Control: max-age=0


2008-05-15 09:30:12,164 [P1-9] DEBUG (HttpServer.java [service]:893) -
Contexts at
/exist/rest/db/kennedyInformation/scratch/eaho/fo_test/renderfo.xq:
[/exist/*=[WebApplicationContext[/exist,eXist XML Database]]]
2008-05-15 09:30:12,165 [P1-9] DEBUG (HttpServer.java [service]:907) -
Try WebApplicationContext[/exist,eXist XML Database],0
2008-05-15 09:30:12,165 [P1-9] DEBUG (HttpContext.java [handle]:1529) -
Handler org.mortbay.jetty.servlet.WebApplicationHandler@16eb6bc
2008-05-15 09:30:12,170 [P1-9] DEBUG (ServletHandler.java [handle]:546)
- servlet=/rest/*=EXistServlet
2008-05-15 09:30:12,171 [P1-9] DEBUG (ServletHttpRequest.java
[setRequestedSessionId]:447) - Got Session 1kzu6hv2l9eq from cookie
2008-05-15 09:30:12,172 [P1-9] DEBUG (ServletHandler.java [handle]:564)
- session=org.mortbay.jetty.servlet.HashSessionManager$Session@14a97b
2008-05-15 09:30:12,173 [P1-9] DEBUG (WebApplicationHandler.java
[dispatch]:467) - chain=null
2008-05-15 09:30:12,174 [P1-9] DEBUG (RESTServer.java [doGet]:271) -
stylesheet = null
2008-05-15 09:30:12,175 [P1-9] DEBUG (RESTServer.java [doGet]:272) -
query = null
2008-05-15 09:30:12,187 [P1-9] DEBUG (RESTServer.java [doGet]:320) -
Call to undeclared function: xslfo:render [at line 7, column 16]
org.exist.xquery.XPathException: Call to undeclared function:
xslfo:render [at line 7, column 16]
        at
org.exist.xquery.XQueryContext.resolveForwardReferences(XQueryContext.java:2018)
        at
org.exist.xquery.parser.XQueryTreeParser.xpath(XQueryTreeParser.java:2824)
        at org.exist.xquery.XQuery.compile(XQuery.java:142)
        at org.exist.xquery.XQuery.compile(XQuery.java:98)
        at org.exist.xquery.XQuery.compile(XQuery.java:89)
        at org.exist.http.RESTServer.executeXQuery(RESTServer.java:979)
        at org.exist.http.RESTServer.doGet(RESTServer.java:309)
        at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:316)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
        at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
        at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
        at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
2008-05-15 09:30:12,189 [P1-9] DEBUG (HttpContext.java [handle]:1534) -
Handled by org.mortbay.jetty.servlet.WebApplicationHandler@16eb6bc
2008-05-15 09:30:12,190 [P1-9] DEBUG (HttpInputStream.java
[resetStream]:235) - resetStream()
2008-05-15 09:30:12,191 [P1-9] DEBUG (HttpConnection.java
[handleNext]:1082) - RESPONSE:
HTTP/1.1 400 Bad Request
Date: Thu, 15 May 2008 14:30:12 GMT
Server: Jetty/5.1.12 (Linux/2.6.22.17-0.1-default i386 java/1.5.0_15
X-XQuery-Cached: false
Content-Type: text/xml; charset=UTF-8
Content-Length: 196
----------------------------------------------------------------------


thanks for all your help so far, I feel that I'm making progress.


Ethan



Adam Retter wrote:

> Function details are -
>
> xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary
>
> Renders a given XSL-FO document. $a is the XSL-FO node, $b is the
> required mime-type, $c is parameters to the transformation.
> Returns an xs:base64binary of the result.
> Parameters are specified with the structure:
> <parameters><param name="param-name1" value="param-value1"/>
> </parameters>
> Recognised rendering parameters are: author, title.
>
> http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xslfo/readme.txt?view=markup
>
> I am not sure why this is not appearing in the functions page if it is
> compiled and enabled, someone also reported the same problem with the
> SQLModule?!? I wonder whats going on here?
>
> Thanks Adam.
>
> 2008/5/14 Ethan Aho <eaho@...>:
>  
>> Dannes,
>>
>> The function rebuild brought up the SQL module functions, but not the
>> XLSFO functions.  I did look at the readme.txt of the module itself and
>> have the jar files in place.  I'm not having much luck figuring out
>> functions and their parameters from reading through code, though.  And
>> since http://demo.exist-db.org/xquery/functions.xq doesn't have the
>> functions either, I'm at a loss of what to try.
>>
>> Ethan
>>
>>
>> Dannes Wessels wrote:
>>    
>>> Hi,
>>>
>>> On Wed, May 14, 2008 at 7:52 PM, Pierrick Brihaye
>>> <pierrick.brihaye@...> wrote:
>>>
>>>      
>>>>> My conf.xml has XSLFOModule module uncommented, but nothing shows in
>>>>> the functions page.  My SQL module works, but never showed up in my
>>>>> functions list either.  Luckily there are documents on how to use SQL
>>>>> with eXist.  I have not been able to find the functions online either
>>>>> (or examples).
>>>>>
>>>>>          
>>> ah right. probably the documentation needs to be regenerated first ;
>>> first remove the collection /db/xqdocs
>>>
>>> regards
>>>
>>> Dannes
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Exist-open mailing list
>>> Exist-open@...
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>>
>>>      
>> --
>> Ethan Aho
>> Database Administrator
>> Kennedy Information
>> (603) 924-0900 ext 611
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Exist-open mailing list
>> Exist-open@...
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>>    
>
>
>
>  

--
Ethan Aho
Database Administrator
Kennedy Information
(603) 924-0900 ext 611


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by PawelKat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
> Function details are -
>
> xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary
>

Hi Adam and others,
Is there the way to pass fop user-conf configuration file (fop.xconf) in this
extension?
I need it in order to embedd ttf fonts.

if fop there is -c parameter in cocoon it's possible to add:
<map:serializer name="fo2pdf"
  src="org.apache.cocoon.serialization.FOPSerializer"
  mime-type="application/pdf">
    <user-config
src="/opt/tomcat/webapps/app/stylesheets/pdf/fonts/fop-fonts config.xml"/>
 </map:serializer>

but I never tried.
If it's not so difficult to add such a parameter, I would be very grateful,
because without that I can't use national fonts with fop.

>
> Function details are -
>
> xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary
>
> Renders a given XSL-FO document. $a is the XSL-FO node, $b is the
> required mime-type, $c is parameters to the transformation.
> Returns an xs:base64binary of the result.
> Parameters are specified with the structure:
> <parameters><param name="param-name1" value="param-value1"/>
> </parameters>
> Recognised rendering parameters are: author, title.
>
>
http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xslfo/readme.txt?view=markup

>
> I am not sure why this is not appearing in the functions page if it is
> compiled and enabled, someone also reported the same problem with the
> SQLModule?!? I wonder whats going on here?
>
> Thanks Adam.
>
> 2008/5/14 Ethan Aho <eaho <at> kennedyinfo.com>:
> > Dannes,
> >
> > The function rebuild brought up the SQL module functions, but not the
> > XLSFO functions.  I did look at the readme.txt of the module itself and
> > have the jar files in place.  I'm not having much luck figuring out
> > functions and their parameters from reading through code, though.  And
> > since http://demo.exist-db.org/xquery/functions.xq doesn't have the
> > functions either, I'm at a loss of what to try.
> >
> > Ethan
> >
> >
> > Dannes Wessels wrote:
> >> Hi,
> >>
> >> On Wed, May 14, 2008 at 7:52 PM, Pierrick Brihaye





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pawel, it was not possible to specify a user config file. However,
I had some spare minutes as some systems at work are down and it
seemed a solid use-case, so I have just added this ability to the
trunk version of eXist. If you build eXist from trunk, the
xslfo:render() function will now look for a parameter called
"user-config" in the parameters, which should be a path to a local FOP
configuration file. If it is present then it will load and configure
FOP according to that file.

Thanks Adam.


2008/5/16 PawelKat <pawelkat@...>:

>>
>> Function details are -
>>
>> xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary
>>
>
> Hi Adam and others,
> Is there the way to pass fop user-conf configuration file (fop.xconf) in this
> extension?
> I need it in order to embedd ttf fonts.
>
> if fop there is -c parameter in cocoon it's possible to add:
> <map:serializer name="fo2pdf"
>  src="org.apache.cocoon.serialization.FOPSerializer"
>  mime-type="application/pdf">
>    <user-config
> src="/opt/tomcat/webapps/app/stylesheets/pdf/fonts/fop-fonts config.xml"/>
>  </map:serializer>
>
> but I never tried.
> If it's not so difficult to add such a parameter, I would be very grateful,
> because without that I can't use national fonts with fop.
>
>>
>> Function details are -
>>
>> xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary
>>
>> Renders a given XSL-FO document. $a is the XSL-FO node, $b is the
>> required mime-type, $c is parameters to the transformation.
>> Returns an xs:base64binary of the result.
>> Parameters are specified with the structure:
>> <parameters><param name="param-name1" value="param-value1"/>
>> </parameters>
>> Recognised rendering parameters are: author, title.
>>
>>
> http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xslfo/readme.txt?view=markup
>>
>> I am not sure why this is not appearing in the functions page if it is
>> compiled and enabled, someone also reported the same problem with the
>> SQLModule?!? I wonder whats going on here?
>>
>> Thanks Adam.
>>
>> 2008/5/14 Ethan Aho <eaho <at> kennedyinfo.com>:
>> > Dannes,
>> >
>> > The function rebuild brought up the SQL module functions, but not the
>> > XLSFO functions.  I did look at the readme.txt of the module itself and
>> > have the jar files in place.  I'm not having much luck figuring out
>> > functions and their parameters from reading through code, though.  And
>> > since http://demo.exist-db.org/xquery/functions.xq doesn't have the
>> > functions either, I'm at a loss of what to try.
>> >
>> > Ethan
>> >
>> >
>> > Dannes Wessels wrote:
>> >> Hi,
>> >>
>> >> On Wed, May 14, 2008 at 7:52 PM, Pierrick Brihaye
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Exist-open mailing list
> Exist-open@...
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Pierrick Brihaye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Adam Retter a écrit :

> If you build eXist from trunk, the
> xslfo:render() function will now look for a parameter called
> "user-config" in the parameters, which should be a path to a local FOP
> configuration file. If it is present then it will load and configure
> FOP according to that file.

Mmmh... usually, we pass an XML element (see, transform:transform(),
util:eval-with-context...)

Of course, we could have another fonction which would be able to
transform an external configuration file into such an element ;-)

<snip/>

Cheers,

p.b.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did consider passing in an XML element instead of a path to the
document and even considered that doc() could be used to load the
external XML file. However with the way that FOP is considered and
this particular use case I did not think it easy or worthwhile.

or would you have gone another way?

All suggestions welcome :-)

2008/5/19 Pierrick Brihaye <pierrick.brihaye@...>:

> Hi,
>
> Adam Retter a écrit :
>
>> If you build eXist from trunk, the
>> xslfo:render() function will now look for a parameter called
>> "user-config" in the parameters, which should be a path to a local FOP
>> configuration file. If it is present then it will load and configure
>> FOP according to that file.
>
> Mmmh... usually, we pass an XML element (see, transform:transform(),
> util:eval-with-context...)
>
> Of course, we could have another fonction which would be able to transform
> an external configuration file into such an element ;-)
>
> <snip/>
>
> Cheers,
>
> p.b.
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: XSL-FO assistance

by Ethan Aho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've still been unsuccessful in getting XSLFO module to work.  For some
reason I'm still getting "Call to undeclared function: xslfo:render".

thank you,
Ethan



Ethan Aho wrote:

> I have succeeded in getting the SQL module working (and functions
> visible).  I'm using eXist 1.2ish.
>
> In my attempts to get XSL-FO working, I have:
> * un-commented the lines needed in conf.xml
> * include.module.xslfo = true has been set in
> extensions/modules/build.properties
> * looked at the readme.txt and added the needed 3 jar files
> * restarted eXist
> * rebooted the server it runs on
> * deleted /db/xqdocs, then regenerated them in the functions section
>
> The results are:
> * No XSLFO functions are visible in the functions list.
> * The below test.xql returns "Call to undeclared function: xslfo:render
> [at line 8, column 16]"
> **  I had tried 'utf8', 'utf-8', '', () for parameter B
>
> Here's the test xql to run a simple fo document
> ----------------------------------------------------------------------
> xquery version "1.0";
> declare namespace xslfo="http://exist-db.org/xquery/xslfo";
> declare variable $fo_doc :=
> doc('/db/kennedyInformation/scratch/eaho/fo_test/fotest.fo');
> let $render := xslfo:render($fo_doc, "utf8", "<parameters/>")
> return $render
> ----------------------------------------------------------------------
>
> Here's what shows up in my log file when I try to run the xql through rest
> ----------------------------------------------------------------------
> 2008-05-15 09:30:12,162 [P1-9] DEBUG (HttpConnection.java [<init>]:115)
> - new HttpConnection: Socket[addr=/10.100.2.11,port=4768,localport=8080]
> 2008-05-15 09:30:12,163 [P1-9] DEBUG (HttpConnection.java
> [handleNext]:978) - REQUEST from P1@...:8080:
> GET /exist/rest/db/kennedyInformation/scratch/eaho/fo_test/renderfo.xq
> HTTP/1.1
> Host: porkins:8080
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)
> Gecko/20080404 Firefox/2.0.0.14
> Accept:
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> Accept-Language: en-us,en;q=0.5
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> keep-alive: 300
> Connection: keep-alive
> Cookie: JSESSIONID=1kzu6hv2l9eq
> Cache-Control: max-age=0
>
>
> 2008-05-15 09:30:12,164 [P1-9] DEBUG (HttpServer.java [service]:893) -
> Contexts at
> /exist/rest/db/kennedyInformation/scratch/eaho/fo_test/renderfo.xq:
> [/exist/*=[WebApplicationContext[/exist,eXist XML Database]]]
> 2008-05-15 09:30:12,165 [P1-9] DEBUG (HttpServer.java [service]:907) -
> Try WebApplicationContext[/exist,eXist XML Database],0
> 2008-05-15 09:30:12,165 [P1-9] DEBUG (HttpContext.java [handle]:1529) -
> Handler org.mortbay.jetty.servlet.WebApplicationHandler@16eb6bc
> 2008-05-15 09:30:12,170 [P1-9] DEBUG (ServletHandler.java [handle]:546)
> - servlet=/rest/*=EXistServlet
> 2008-05-15 09:30:12,171 [P1-9] DEBUG (ServletHttpRequest.java
> [setRequestedSessionId]:447) - Got Session 1kzu6hv2l9eq from cookie
> 2008-05-15 09:30:12,172 [P1-9] DEBUG (ServletHandler.java [handle]:564)
> - session=org.mortbay.jetty.servlet.HashSessionManager$Session@14a97b
> 2008-05-15 09:30:12,173 [P1-9] DEBUG (WebApplicationHandler.java
> [dispatch]:467) - chain=null
> 2008-05-15 09:30:12,174 [P1-9] DEBUG (RESTServer.java [doGet]:271) -
> stylesheet = null
> 2008-05-15 09:30:12,175 [P1-9] DEBUG (RESTServer.java [doGet]:272) -
> query = null
> 2008-05-15 09:30:12,187 [P1-9] DEBUG (RESTServer.java [doGet]:320) -
> Call to undeclared function: xslfo:render [at line 7, column 16]
> org.exist.xquery.XPathException: Call to undeclared function:
> xslfo:render [at line 7, column 16]
>         at
> org.exist.xquery.XQueryContext.resolveForwardReferences(XQueryContext.java:2018)
>         at
> org.exist.xquery.parser.XQueryTreeParser.xpath(XQueryTreeParser.java:2824)
>         at org.exist.xquery.XQuery.compile(XQuery.java:142)
>         at org.exist.xquery.XQuery.compile(XQuery.java:98)
>         at org.exist.xquery.XQuery.compile(XQuery.java:89)
>         at org.exist.http.RESTServer.executeXQuery(RESTServer.java:979)
>         at org.exist.http.RESTServer.doGet(RESTServer.java:309)
>         at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:316)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>         at
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>         at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
>         at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
>         at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>         at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> 2008-05-15 09:30:12,189 [P1-9] DEBUG (HttpContext.java [handle]:1534) -
> Handled by org.mortbay.jetty.servlet.WebApplicationHandler@16eb6bc
> 2008-05-15 09:30:12,190 [P1-9] DEBUG (HttpInputStream.java
> [resetStream]:235) - resetStream()
> 2008-05-15 09:30:12,191 [P1-9] DEBUG (HttpConnection.java
> [handleNext]:1082) - RESPONSE:
> HTTP/1.1 400 Bad Request
> Date: Thu, 15 May 2008 14:30:12 GMT
> Server: Jetty/5.1.12 (Linux/2.6.22.17-0.1-default i386 java/1.5.0_15
> X-XQuery-Cached: false
> Content-Type: text/xml; charset=UTF-8
> Content-Length: 196
> ----------------------------------------------------------------------
>
>
> thanks for all your help so far, I feel that I'm making progress.
>
>
> Ethan
>
>
>
> Adam Retter wrote:
>  
>> Function details are -
>>
>> xslfo:render($a as node(), $b as xs:string, $c as node()) as xs:base64Binary
>>
>> Renders a given XSL-FO document. $a is the XSL-FO node, $b is the
>> required mime-type, $c is parameters to the transformation.
>> Returns an xs:base64binary of the result.
>> Parameters are specified with the structure:
>> <parameters><param name="param-name1" value="param-value1"/>
>> </parameters>
>> Recognised rendering parameters are: author, title.
>>
>> http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xslfo/readme.txt?view=markup
>>
>> I am not sure why this is not appearing in the functions page if it is
>> compiled and enabled, someone also reported the same problem with the
>> SQLModule?!? I wonder whats going on here?
>>
>> Thanks Adam.
>>
>> 2008/5/14 Ethan Aho <eaho@...>:
>>  
>>    
>>> Dannes,
>>>
>>> The function rebuild brought up the SQL module functions, but not the
>>> XLSFO functions.  I did look at the readme.txt of the module itself and
>>> have the jar files in place.  I'm not having much luck figuring out
>>> functions and their parameters from reading through code, though.  And
>>> since http://demo.exist-db.org/xquery/functions.xq&nbs