Re: fop: problem with dyn:evaluate

2009-10-08 Thread Krishna Komoravolu
Finally, figured out how to use saxon:evaluate instead with saxon9!

For those who may be interested in a similar solution, this should work:




===>




Thanks for all your help!  I didn't realize that swapping XSLT engines
in FOP was so simple.
All I had to do was drop in the jar file in appropriate dir and update
fop front-end script (as
mentioned above).

Krishna

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop: problem with dyn:evaluate

2009-10-07 Thread Krishna Komoravolu
Johathan,

Thanks for your help!
I've used Saxon-6.5.5 as my XSLT processor, edited FOP wrapper to
invoke the jar file
corresponding to Saxon engine, and now everything works perfectly in a
single pass, without
any intermediate steps. (btw, I tried command line mode for xalan-j
engine, and sure enough, it
was a bug with xalan; got the same error - missing data in some columns).

Then, I got a little greedy, got excited at the prospect of being able
to use XSLT 2.0 engine with
FOP (which I thought was not possible till now), and downloaded
SaxonHE9.2 with FOP. It worked
fine for a basic xslt, but when I tried to use saxon:evaluate() (after
declaring xmlns:saxon="http://saxon.sf.net/";), it wouldn't work.
Learned the hard way (after digging through
message boards, and reading the release document carefully) that Saxon
extension are no longer
supported in this version.

So, I tried Saxon-B9.1.7 (saxon9.jar, which would still provide XSLT
2.0 engine), but I got different
kind of error  with saxon:evaluate(), although the same stylesheet
with a subtle change in the name
space  declaration (i.e xmlns:saxon="http://icl.com/saxon";) worked
perfectly with Saxon-6.5.5.
Saxon-B9.1.7 gave the following error:

Error at xsl:value-of on line 91 of projFoSimple.xsl:
  Static error in XPath expression supplied to saxon:evaluate:
Undeclared variable in XPath.

The offending lines are:



I know this is not directly related to FOP, but am just hoping that
FOP users with similar
problem may already have found a workaround for this problem.
Since I'm starting my stylesheets from scratch, I'm eager to start
with XSLT2.0 engine (which
supposedly gives lot more flexibility).

Thanks!
Krishna



On Wed, Oct 7, 2009 at 9:33 AM, Jonathan Levinson
> I attach a fopwithsaxon.bat1 (change to .example to run) which shows how to 
> use FOP with saxon.jar.  I hope it is helpful for you.
>
> The critical lines are the following:
>
> set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\saxon.jar
>
> set JAVAOPTS=-Denv.windir=%WINDIR% 
> -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl
>
> You will have to google for saxon.jar and put it in the \lib 
> area for this particular batch file to work.
>
> Best Regards,
> Jonathan S. Levinson

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop: problem with dyn:evaluate

2009-10-07 Thread Manuel Mall

You may be better off asking XSLT related questions on other mailing lists as
this is not a FOP issue as such.

According to http://www.exslt.org/dyn/functions/evaluate/index.html
dyn:evaluate is supported by XALAN-J. I suggest you look on the exslt or
xalan-j mailinglists/forums.

Manuel


KrisKom wrote:
> 
> I just downloaded newer version of xalan-j (2.7.1), replaced the
> xalan_2_7_0 with this one, but
> got the same result..
> 
> Well, looks like the only option at this point is to use xsltproc to
> generate .fo, and then use fop
> to generate pdf. The problem with this approach is that I need to generate
> around 50+ complex
> reports from a single large XML output file at the end of a run (a C++
> application), and now I'd
> end up creating 50+ .fo files in addition to the pdfs.
> 
> Krishna
> 
> 
> KrisKom wrote:
>> 
>> 'system-property()' for xsl:vendor: Apache Software Foundation, and
>> vendor-url: http://xml.apache.org/xalan-j
>> 
>> JRE on my machine (Windows XP/Cygwin): 1.6.0_15
>> 
>> I've used '--execdebug' flag when starting fop to print out the actual
>> command
>> being executed, nothing unusual about it: classpath doesn't contain any
>> weird
>> stuff i.e. everything there belongs to jar files under $FOP_HOME dir
>> (fop version
>> 0.95, which I've downloaded recently, about a month ago).
>> 
>> The jar file for xalan is xalan-2.7.0.jar (so don't know if a newer
>> version of this jar
>> is available).
>> 
>> All the jar files that are listed in the fop's classpath (generated by
>> fop script)
>> are:
>> ics-commons-1.3.1.jar
>> fop-0.95/lib/xml-apis-ext-1.3.04.jar
>> fop-0.95/lib/xml-apis-1.3.04.jar
>> fop-0.95/lib/xercesImpl-2.7.1.jar
>> fop-0.95/lib/xalan-2.7.0.jar
>> fop-0.95/lib/serializer-2.7.0.jar
>> fop-0.95/lib/commons-logging-1.0.4.jar
>> fop-0.95/lib/commons-io-1.3.1.jar
>> fop-0.95/lib/batik-all-1.7.jar
>> fop-0.95/lib/avalon-framework-4.2.0.jar
>> fop-0.95/build/fop.jar
>> fop-0.95/build/fop-sandbox.jar
>> fop-0.95/build/fop-hyph.jar"
>> 
>> 
>> 
>> On Mon, Oct 5, 2009 at 4:00 PM, J.Pietschmann  wrote:
>>> On 03.10.2009 21:30, KrisKom wrote:
>>> [snip]

>> ...
 My xsl stylesheet works as expected if I run it through a pro-processor
 (xsltproc) to generate
 .fo, and then use fop to convert this .fo into a pdf. But, when I use
 fop
 directly (i.e. single step: fop -xml
 blah.xml -xsl blah.xsl -pdf out.pdf), I'm getting weird results
>> ...
>>>
>>> FOP uses the default XSLT processor from your Java installation.
>>> Chances are, it doesn't recognize certain EXSLT constructs.
>>>
>>> You can try to use the XSLT function system-property() to check
>>> what kind of processor is used, e.g.
>>>  
>>> should give you a hint, looking up other, vendor specific properties
>>> might get you further.
>>> You can use other Java based XSLT processors with FOP, simply get the
>>> necessary jar files, add them to the CLASSPATH, and set the java system
>>> property javax.xml.transform.TransformerFactory to the processor's
>>> transformer factory class.
>>>
>>> J.Pietschmann
>>>
>> 
>> -
>> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/fop%3A-problem-with-dyn%3Aevaluate-tp25731998p25783767.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop: problem with dyn:evaluate

2009-10-06 Thread KrisKom

I just downloaded newer version of xalan-j (2.7.1), replaced the xalan_2_7_0
with this one, but
got the same result..

Well, looks like the only option at this point is to use xsltproc to
generate .fo, and then use fop
to generate pdf. The problem with this approach is that I need to generate
around 50+ complex
reports from a single large XML output file at the end of a run (a C++
application), and now I'd
end up creating 50+ .fo files in addition to the pdfs.

Krishna


KrisKom wrote:
> 
> 'system-property()' for xsl:vendor: Apache Software Foundation, and
> vendor-url: http://xml.apache.org/xalan-j
> 
> JRE on my machine (Windows XP/Cygwin): 1.6.0_15
> 
> I've used '--execdebug' flag when starting fop to print out the actual
> command
> being executed, nothing unusual about it: classpath doesn't contain any
> weird
> stuff i.e. everything there belongs to jar files under $FOP_HOME dir
> (fop version
> 0.95, which I've downloaded recently, about a month ago).
> 
> The jar file for xalan is xalan-2.7.0.jar (so don't know if a newer
> version of this jar
> is available).
> 
> All the jar files that are listed in the fop's classpath (generated by
> fop script)
> are:
> ics-commons-1.3.1.jar
> fop-0.95/lib/xml-apis-ext-1.3.04.jar
> fop-0.95/lib/xml-apis-1.3.04.jar
> fop-0.95/lib/xercesImpl-2.7.1.jar
> fop-0.95/lib/xalan-2.7.0.jar
> fop-0.95/lib/serializer-2.7.0.jar
> fop-0.95/lib/commons-logging-1.0.4.jar
> fop-0.95/lib/commons-io-1.3.1.jar
> fop-0.95/lib/batik-all-1.7.jar
> fop-0.95/lib/avalon-framework-4.2.0.jar
> fop-0.95/build/fop.jar
> fop-0.95/build/fop-sandbox.jar
> fop-0.95/build/fop-hyph.jar"
> 
> 
> 
> On Mon, Oct 5, 2009 at 4:00 PM, J.Pietschmann  wrote:
>> On 03.10.2009 21:30, KrisKom wrote:
>> [snip]
>>>
> ...
>>> My xsl stylesheet works as expected if I run it through a pro-processor
>>> (xsltproc) to generate
>>> .fo, and then use fop to convert this .fo into a pdf. But, when I use
>>> fop
>>> directly (i.e. single step: fop -xml
>>> blah.xml -xsl blah.xsl -pdf out.pdf), I'm getting weird results
> ...
>>
>> FOP uses the default XSLT processor from your Java installation.
>> Chances are, it doesn't recognize certain EXSLT constructs.
>>
>> You can try to use the XSLT function system-property() to check
>> what kind of processor is used, e.g.
>>  
>> should give you a hint, looking up other, vendor specific properties
>> might get you further.
>> You can use other Java based XSLT processors with FOP, simply get the
>> necessary jar files, add them to the CLASSPATH, and set the java system
>> property javax.xml.transform.TransformerFactory to the processor's
>> transformer factory class.
>>
>> J.Pietschmann
>>
> 
> -
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/fop%3A-problem-with-dyn%3Aevaluate-tp25731998p25780509.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop: problem with dyn:evaluate

2009-10-06 Thread Krishna Komoravolu
'system-property()' for xsl:vendor: Apache Software Foundation, and
vendor-url: http://xml.apache.org/xalan-j

JRE on my machine (Windows XP/Cygwin): 1.6.0_15

I've used '--execdebug' flag when starting fop to print out the actual command
being executed, nothing unusual about it: classpath doesn't contain any weird
stuff i.e. everything there belongs to jar files under $FOP_HOME dir
(fop version
0.95, which I've downloaded recently, about a month ago).

The jar file for xalan is xalan-2.7.0.jar (so don't know if a newer
version of this jar
is available).

All the jar files that are listed in the fop's classpath (generated by
fop script)
are:
ics-commons-1.3.1.jar
fop-0.95/lib/xml-apis-ext-1.3.04.jar
fop-0.95/lib/xml-apis-1.3.04.jar
fop-0.95/lib/xercesImpl-2.7.1.jar
fop-0.95/lib/xalan-2.7.0.jar
fop-0.95/lib/serializer-2.7.0.jar
fop-0.95/lib/commons-logging-1.0.4.jar
fop-0.95/lib/commons-io-1.3.1.jar
fop-0.95/lib/batik-all-1.7.jar
fop-0.95/lib/avalon-framework-4.2.0.jar
fop-0.95/build/fop.jar
fop-0.95/build/fop-sandbox.jar
fop-0.95/build/fop-hyph.jar"

So, any idea which jar to replace (and with what)?  By other XSLT processors,
do you mean something like FOray (but it appears to be a replacement for FOP?)


(For xsltproc, vendor is 'libxslt', non-java dll)


Thanks!

Krishna

On Mon, Oct 5, 2009 at 4:00 PM, J.Pietschmann  wrote:
> On 03.10.2009 21:30, KrisKom wrote:
> [snip]
>>
...
>> My xsl stylesheet works as expected if I run it through a pro-processor
>> (xsltproc) to generate
>> .fo, and then use fop to convert this .fo into a pdf. But, when I use fop
>> directly (i.e. single step: fop -xml
>> blah.xml -xsl blah.xsl -pdf out.pdf), I'm getting weird results
...
>
> FOP uses the default XSLT processor from your Java installation.
> Chances are, it doesn't recognize certain EXSLT constructs.
>
> You can try to use the XSLT function system-property() to check
> what kind of processor is used, e.g.
>  
> should give you a hint, looking up other, vendor specific properties
> might get you further.
> You can use other Java based XSLT processors with FOP, simply get the
> necessary jar files, add them to the CLASSPATH, and set the java system
> property javax.xml.transform.TransformerFactory to the processor's
> transformer factory class.
>
> J.Pietschmann
>

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop: problem with dyn:evaluate

2009-10-05 Thread J.Pietschmann

On 03.10.2009 21:30, KrisKom wrote:
[snip]

I used xsl:for-each to loop over RoleTypes/* elements to define table
columns, and then
dynamically constructed XPath expression (using dyn:evaluate of exslt) to
obtain data for
the cells that correspond to the roles (dev, qa, and doc).

My xsl stylesheet works as expected if I run it through a pro-processor
(xsltproc) to generate
.fo, and then use fop to convert this .fo into a pdf. But, when I use fop
directly (i.e. single step: fop -xml
blah.xml -xsl blah.xsl -pdf out.pdf), I'm getting weird results - only the
first column's data (i.e. the first
sub-element of 'RoleTypes', in this example - 'dev') and rest of the colums
are blank.
Is this a bug with fop (as it seems to recognize dyn:evaluate, but doesn't
do a complete job)??


FOP uses the default XSLT processor from your Java installation.
Chances are, it doesn't recognize certain EXSLT constructs.

You can try to use the XSLT function system-property() to check
what kind of processor is used, e.g.
 
should give you a hint, looking up other, vendor specific properties
might get you further.
You can use other Java based XSLT processors with FOP, simply get the
necessary jar files, add them to the CLASSPATH, and set the java system
property javax.xml.transform.TransformerFactory to the processor's
transformer factory class.

J.Pietschmann

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



fop: problem with dyn:evaluate

2009-10-03 Thread KrisKom

I'm a new user on this forum, and have sent an email to the mailing list on
this subject, but it bounced
back.  So pardon me if you see this question twice.

I've been struggling with some weird behavior of fop (don't know if I'm
doing something wrong, or if there 
is a work around).

I have an auto generated XML as follows:


 Report Generation
 
 
 
 
 
 
   John
   200
 
 
   Max
   60
 
 
   Henry
   80
 
 
   Peter
   40
 


(Note: This is a mocked up example, but I have a very similar need where I
need to generate
reports at the end of a job with sevaral colums akin to roleTypes)

My goal is to display the above data in pdf as follows:
Name   | dev | qa | doc |
--
John| 100 |  |   |
Max |  60 |  |   |
Henry  |   |  80 |   |
Peter   |   |  40 |   |

I used xsl:for-each to loop over RoleTypes/* elements to define table
columns, and then
dynamically constructed XPath expression (using dyn:evaluate of exslt) to
obtain data for
the cells that correspond to the roles (dev, qa, and doc).

My xsl stylesheet works as expected if I run it through a pro-processor
(xsltproc) to generate
.fo, and then use fop to convert this .fo into a pdf. But, when I use fop
directly (i.e. single step: fop -xml 
blah.xml -xsl blah.xsl -pdf out.pdf), I'm getting weird results - only the
first column's data (i.e. the first
sub-element of 'RoleTypes', in this example - 'dev') and rest of the colums
are blank.
Is this a bug with fop (as it seems to recognize dyn:evaluate, but doesn't
do a complete job)??

I would really like to use the single step fop so that I wouldn't need to
deploy additional tools on the client
box (like xsltproc etc).

Here's the stylesheet segment that I've been using:

   
   
   
   
   

   
   
   
  
Name
   
   
   
   
   
   
   

   
   
   
   
   
   

   

   
   
   
   
   
   

   
   
   
   

Thanks,

Krishna
-- 
View this message in context: 
http://www.nabble.com/fop%3A-problem-with-dyn%3Aevaluate-tp25731998p25731998.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org