Re: Java Extensions in Xalan vs Fop

2001-07-17 Thread Gareth Noyce

 I hear your pain, brother. :-) So I have enclosed a ZIP which contains all
 the files I used, on Windows 98, to make this work - the XML, XSL, the
 extension class (source and compiled classfile), a batch file to run
things,
 even the PDF output.

Father Arved, thank for you for your preaching!

Ok, this initially didn't work, but the bat file made me notice something
that I'd not seen before. My classpath was too long for the commandline that
you included in the batch file to run. Thinking this might have something to
do with it I cut it all down to just the FOP and Xalan stuff that I need
right now. Lo! All worked out of the tin. All my example files, your batch
file -- pretty much everything I've been playing with since Thursday.

So, the evils of the CLASSPATH seem to have struck again. For the record,
everything you'd included in your example I had in my classpath (bar the
example java I'd written), but it just seemed to get ignored. Removing bits
make all the difference.

That is some weight off my shoulders, although I feel a little silly having
wasted so long playing around with it!

Thank you again for your help and support.

Best Regards

Gareth Noyce


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Java Extensions in Xalan vs Fop

2001-07-16 Thread Gareth Noyce


 I understand this error to be along the lines of a Can't find class
 BchDate, as I had the same problem with Xalan whilst learning how to
 implement extensions.

 I think you're right, as far as the semantics of the ERROR message is
 concerned. One reason you can't find a class is because you didn't compile
 the source; are you sure you have the _classfile_ available that
corresponds
 to your BchDate class?

Hi, thanks for the reply,

Firstly, yes the class file is present on the class path. The class is
compiled -- I can call util.BchDate (I've just packaged it to follow your
example) from anywhere on the commandline and the function main I added to
test the classpath works as expected, passes a dummy date to getDate, and
the formatted string is returned. From this I take it that the java code is
correct, works fine, and is present (compiled) on the classpath.. All is
well in that regard.

As previsouly mentioned, all my files work fine in Xalan. No changes need to
be made _at all_ to get Xalan to run the Java and output an FO file. This is
also true for the test files created with your example code discussed below:

 My final example is very close to yours. Here is the stylesheet root:

Thanks for that, I've cut and past your example snippets into two new files,
and the errors returned by FOP are the same. However, when the bchext
namespace prefix is used I now get:

Error: For extension function, could not find method
java.lang.String.getDate([expressionContext])

To me this indicates that the xalan://util.BchDate prefix is being ignored
entirely. I see no reason why FOP should believe that getDate is a method of
class String and call it as such. It's not like getDate returns a string
even! :-)

So, with the failure of that may I ask you the following:

Are you running this under NT?
Where on your classpath did you put the util.BchDate package (ie:
c:\data\bch\javacode\)?
What version of FOP are you using?
Any other suggestions?!

Thanks for your time, Best Regards

Gareth Noyce


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Oddity with Java Extensions Functions

2001-07-14 Thread Gareth Noyce

Hi all,

Firstly, many thanks for the hard work on FOP -- it's a great piece of work.

Unfortunately I've stumbled upon a problem which I'm at a loss to figure
out. I'm hoping that someone on the list will be able to shed some light on
the problem.

I've been playing with Java Extension functions under Xalan with great
success. I need to move one of these over to go through FOP in order to
process dates, so I've slightly amended the example as provided with Xalan
to better suit my needs.

I've got a small test xml file which contains the following:


[g-test.xml]
--
?xml version=1.0?
gtest
date2001-07-11/date
/gtest
--

The XSL file generates a FO file suitable for processing by FOP. Cutting out
most of the cruft, the file is as follows:


[g-test.xsl]
--
?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:java=http://xml.apache.org/xslt/java; xmlns:bchext=xalan://BchDate


 xsl:template match=/

fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

  !-- Layout the page dimensions. A4 landscape... --

[SNIP]

  !-- Start the page sequence... Each page will follow this
odel...  --

[SNIP]

/fo:root
 /xsl:template

xsl:template match=date

  !-- This is the format mask for SimpleDateFormat --
  xsl:variable name=format select=string('EEE MMM dd ')/

  xsl:variable name=date select=string(.)/


fo:table font-size=7pt
[TABLE COLUMN SETUP / SNIP]

fo:table-header
[SNIP]
/fo:table-header

fo:table-body
  fo:table-row
fo:table-cell
  fo:block border-right-width=0.5pt text-align=center
vertical-align=middle border-style=solid line-height=11pt
xsl:variable name=formatter
select=java:java.text.SimpleDateFormat.new($format)/
xsl:variable name=formatdate
select=java:BchDate.getDate($date)/
xsl:value-of select=java:format($formatter,
$formatdate)/
  /fo:block
/fo:table-cell

...
[SNIP]
...

  /fo:table-row
/fo:table-body
  /fo:table
/xsl:template
/xsl:stylesheet

--

I'll leave out the Java class for brevity, it's basically the same as the
3-java-namespace example from Xalan.

The Java class is on the classpath, I included a function 'main' to test
this and all works fine. The XML, XSL and Java will all process through
Xalan as expected, and an XSL:FO file is produced correctly, no problems.
However, I wish to use FOP to do all this in one go with the usual
java -jar fop.jar -xml g-test.xml -xsl g-test.xsl -pdf out.pdf -- and this
is where my problem crops up. When I run the command as shown, the error:

filepath; Line 123; Column 87; ERROR: BchDate

is shown.

I understand this error to be along the lines of a Can't find class
BchDate, as I had the same problem with Xalan whilst learning how to
implement extensions.

Can anyone point out what stupid mistake I am making here? I'm at a loss as
to why the same files will process with Xalan-j_2_2_D6 and yet not with
FOP-0.19 which, as I understand it, uses Xalan for the XSLT stage... I've
double checked the CLASS_PATH settings, tested the Java and been all over
the website trying to figure out if I should be using a different namespace
setting for FOP (things aren't particularly clear, there or in the docs).

I'm running NT4 for development, and the server is 2k. Java is JDK1.3.1 from
Sun.

I'm sorry for the length of the post. I thought it would save time to
explain things as verbosly as possible!

Thanks in advance for your time,  best regards

Gareth Noyce

P.S. I'll happily send all my test files to anyone off list if it helps.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Java Extensions in Xalan vs Fop

2001-07-13 Thread Gareth Noyce

  The Java class is on the classpath, I included a function 'main' to test
  this and all works fine. The XML, XSL and Java will all process through
  Xalan as expected, and an XSL:FO file is produced correctly, no
problems.
  However, I wish to use FOP to do all this in one go with the usual
  java -jar fop.jar -xml g-test.xml -xsl g-test.xsl -pdf out.pdf -- and
this
  is where my problem crops up. When I run the command as shown, the
error:

 I may get something wrong, but don't you have to specify an additional
 -cp for you BchDate class? fop.jar contains a manifest file which
 specifies the classpath to use. If you need more than the standard
 packages, I'd write something like:

 java -jar -cp yourPath fop.jar -xml ...

 I didn't test this but it's worth a try.

Hi Jeremias,

Thanks for the response; I've already tried explicitly giving the classpath,
and I've also put the compiled class in the same directory as the fop.jar
file to see if that made any difference. Neither of these has solved the
problem.

Can anyone offer any other suggestions?

Regards

Gareth Noyce



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Java Extensions in Xalan vs Fop

2001-07-12 Thread Gareth Noyce

Hi all,

Firstly, many thanks for the hard work on FOP -- it's a great piece of work.

Unfortunately I've stumbled upon a problem which I'm at a loss to figure
out. I'm hoping that someone on the list will be able to shed some light on
the problem.

I've been playing with Java Extension functions under Xalan with great
success. I need to move one of these over to go through FOP in order to
process dates, so I've slightly amended the example as provided with Xalan
to better suit my needs and to test the process.

I've got a small test xml file which contains the following:


[g-test.xml]
--
?xml version=1.0?
gtest
date2001-07-11/date
/gtest
--

The XSL file generates a FO file suitable for processing by FOP. Cutting out
most of the cruft, the file is as follows:


[g-test.xsl]
--
?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:java=http://xml.apache.org/xslt/java; xmlns:bchext=xalan://BchDate


 xsl:template match=/

fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

  !-- Layout the page dimensions. A4 landscape... --

 [SNIP]

  !-- Start the page sequence... Each page will follow this
odel...  --

 [SNIP]

/fo:root
 /xsl:template

xsl:template match=date

  !-- This is the format mask for SimpleDateFormat --
  xsl:variable name=format select=string('EEE MMM dd ')/

  xsl:variable name=date select=string(.)/


fo:table font-size=7pt
 [TABLE COLUMN SETUP / SNIP]

 fo:table-header
 [SNIP]
 /fo:table-header

 fo:table-body
   fo:table-row
 fo:table-cell
   fo:block border-right-width=0.5pt text-align=center
vertical-align=middle border-style=solid line-height=11pt
xsl:variable name=formatter
select=java:java.text.SimpleDateFormat.new($format)/
xsl:variable name=formatdate select=java:BchDate.getDate
($date)/
xsl:value-of select=java:format($formatter,
$formatdate)/
   /fo:block
 /fo:table-cell

  ...
  [SNIP]
  ...

   /fo:table-row
 /fo:table-body
  /fo:table
/xsl:template
/xsl:stylesheet

--

I'll leave out the Java class for brevity, it's basically the same as the
3-java-namespace example from Xalan.

The Java class is on the classpath, I included a function 'main' to test
this and all works fine. The XML, XSL and Java will all process through
Xalan as expected, and an XSL:FO file is produced correctly, no problems.
However, I wish to use FOP to do all this in one go with the usual
java -jar fop.jar -xml g-test.xml -xsl g-test.xsl -pdf out.pdf -- and this
is where my problem crops up. When I run the command as shown, the error:

filepath; Line 123; Column 87; ERROR: BchDate

is shown.

I understand this error to be along the lines of a Can't find class
BchDate, as I had the same problem with Xalan whilst learning how to
implement extensions.

Can anyone point out what stupid mistake I am making here? I'm at a loss as
to why the same files will process with Xalan-j_2_2_D6 and yet not with
FOP-0.19 which, as I understand it, uses Xalan for the XSLT stage... I've
double checked the CLASS_PATH settings, tested the Java and been all over
the website trying to figure out if I should be using a different namespace
setting for FOP (things aren't particularly clear, there or in the docs).

I'm running NT4 for development, and the server is 2k. Java is JDK1.3.1 from
Sun.

I'm sorry for the length of the post. I thought it would save time to
explain things as verbosly as possible!

Thanks in advance for your time,  best regards

Gareth Noyce

P.S. I'll happily send all my test files to anyone off list if it helps.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]