Re: variable and svg

2002-11-05 Thread J.Pietschmann
xavier gibouin wrote:
  
...
but fop doesn't want assign the value of $x in "rec" tag
It's not FOP, its the XSLT processor.
Use
 
This is called "attribute value template", look up details in
an XSLT book, a tutorial or the XSL FAQ.
XSLT questions like this are better asked on the XSL list:
 http://www.mulberrytech.com/xsl/xsl-list/
J.Pietschmann


Re: Root element must be root, not (none):glossary

2002-11-05 Thread J.Pietschmann
Deon van der Merwe wrote:
org.apache.fop.apps.FOPException: Root element must be root, not (none):glossary
at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source)
at 
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:575)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
^^^
This may be the problem. The Crimson parser is said to not
implementing namespace support. Check your CLASSPATH environment
variable and remove jars like parser.jar or crimson.jar. If there
is no such jar, or the problem persists, check Tomcat's lib
directory, the startup options, the startup script and perhaps
your WEB-INF/lib as well.
Other recommendations
> jakarta-tomcat-4.0.1
Upgrade to a more recent release (4.0.6, I think)
> java version "1.3.0"
This version is said to have several nasty bugs on Linux,
which may cause it to segfault during FOP runs. Try to get
a 1.3.1_1 or newer.
J.Pietschmann


Re: breaking paragraphs and lines

2002-11-05 Thread J.Pietschmann
Koes, Derrick wrote:
You may want to try white-space-collapse="false" as an attribute on your
fo:block.  There are also other white space attributes that may be useful.
I'm not sure if all are supported in fop 0.20.4.
None of them is supported in 0.20.4.
J.Pietschmann


Re: OutOfMemoryError on Websphere, not in WSAD test environment

2002-11-05 Thread J.Pietschmann
Davor Cengija wrote:
I'll try different fonts and FOP versions and let you know what happens.
Check the memory settings of your JVM first. The Unix version
may have a smaller default, or things just take up more space
there (caching, threadss, whatever), or you are even using a
completely different JVM version.
Consult your friendly WebSphere manual about where to set
addidional JVM flags.
J.Pietschmann


Re: Quark workflow

2002-11-05 Thread Oleg Tkachenko
Joel Gwynn wrote:
Quark template -> Quark XML -> [???] -> FOP -> PDF
How do I get from Quark XML to XSL-FO.
Well, there is no magic here, Quark XML can be transformed into xsl-fo 
as any other xml using XSL Transormations language. Learn Quark XML 
syntax and semantics, develop such a stylesheet and many people will 
thank you.

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


Re: Quark workflow

2002-11-05 Thread clholm


You may want to consider Apache Cocoon. Look here:
 http://xml.apache.org/cocoon/index.html
and (more specifically) here:
http://xml.apache.org/cocoon/userdocs/serializers/pdf-serializer.html
- Carl Holm
 
Joel Gwynn wrote:
Hello all.  I do variable data for a printing
company.  I'm trying to
design a workflow as follows:
Quark template -> Quark XML -> [???] -> FOP -> PDF
How do I get from Quark XML to XSL-FO.  Also, I need a connection
to
SQL-Server somewhere in there too, of course.
Thanks for helping a newbie.
Joel Gwynn
Variable Data
Spire
617 832-1957



RE: breaking paragraphs and lines

2002-11-05 Thread Koes, Derrick
You may want to try white-space-collapse="false" as an attribute on your
fo:block.  There are also other white space attributes that may be useful.
I'm not sure if all are supported in fop 0.20.4.


-Original Message-
From: Stephen Haberman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 05, 2002 1:00 AM
To: [EMAIL PROTECTED]
Subject: breaking paragraphs and lines

Hi,

After much debate between whether I'd pick up LaTeX or XML-FO as my
preferred environment for writing reports and the like, I went with
XML-FO, FOP specifically, and have been enjoying it so far (ah, clean
separate of data and presentation).

However, I've run into a small problem I thought some others might be
able to shed some light on.

One of the things I liked about LaTeX was that two newlines were taken
to mean separate paragraphs. As far as reproducing this before with FOP
using XML/XSLT is that I'd probably have to:

1) Use Xalan to stitch XML/XSLT together. All text blocks would be in
generic fo:blocks, e.g.:


  
text

text
  


2) Run this result through a text manipulation program to replace all of
the \n\n with  to simulate a paragraph break.

3) Run this result through FOP.

I'm thinking this will work once I get some scripts setup for it, but
I'm just wondering if there is a better, within-FO/FOP way?

Also, a subset of this problem is that I was wanting to have a little
bit of control over breaking from the XML file, e.g. force a line break.
E.g.:


   This is a long line that I want brokenhere.


So I was going to use the same approach of a double  to put
the text in, but then have a match against br and insert an artificial
block/inline-container type thing. The problem is that the match against
br has to look like:


  


  


With straight Xalan, the result is exactly what I want... the closing,
opening fo:block comes out in XML just like the previous opening
fo:block. However, FOP seems to ignore this
disable-output-escaping="yes" attribute and I see the literal
"" text in the PDF instead of it being interpreted
it as FO commands. If I run the result of Xalan on the same XML/XSLT
file through FOP via -fo, then it works great.

Any insight into either of the two issues I'm pondering would be greatly
appreciated. This is fun stuff.

Thanks,
Stephen
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.


RE: incrementing variable

2002-11-05 Thread Phil Dickinson



Xavier,
 
Each 
time you use the syntax  you are declaring a 
new local variable, not modifying the existing one!
 
Since 
your output text occurs before the new declaration, the global value is 
output displayed and this is always ten.
 
Try 
moving the fo:block section to after the declaration of the new 
variable.
 
Phil 
Dickinson
Aicom 
Limited
 

  -Original Message-From: xavier gibouin 
  [mailto:[EMAIL PROTECTED]Sent: 05 November 2002 17:59To: 
  [EMAIL PROTECTED]Subject: Re: incrementing 
  variable
  hi this is my xsl code :
   
  http://www.w3.org/1999/XSL/Transform" 
  xmlns:fo="http://www.w3.org/1999/XSL/Format" 
  xmlns:svg="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd">   
   
  
   
    
   
     
   
  this code always writes
  10
  10
  10
  10
  10
  ...
   
  $x is not incremented
   
  any ideas?
   
  thanks a lot
   
  Xavier GibouinAxonieEspace Mercoeur8, 
  rue Mercoeur44000 Nantes02.40.48.53.23[EMAIL PROTECTED]
  
- Original Message - 
From: 
Paul 
Washinger 
To: [EMAIL PROTECTED] 
Sent: Tuesday, November 05, 2002 5:52 
PM
Subject: Re: variable and svg
put braces around the variable when it is outside an xsl 
tag:  


Re: incrementing variable

2002-11-05 Thread xavier gibouin



hi this is my xsl code :
 
http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format" 
xmlns:svg="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd">   
 

 
  
 
   
 
this code always writes
10
10
10
10
10
...
 
$x is not incremented
 
any ideas?
 
thanks a lot
 
Xavier GibouinAxonieEspace Mercoeur8, 
rue Mercoeur44000 Nantes02.40.48.53.23[EMAIL PROTECTED]

  - Original Message - 
  From: 
  Paul 
  Washinger 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, November 05, 2002 5:52 
  PM
  Subject: Re: variable and svg
  put braces around the variable when it is outside an xsl 
  tag:  


RE: no-break space in unicode font

2002-11-05 Thread Doherty, Michael
It turns out that this was reported before - see the archive at 
http://marc.theaimsgroup.com/?l=fop-user&m=103013335612166&w=2

Apparently, this is a bug in FOP 0.20.4 but I have been successful
in creating a workaround - I used a font editor (like pfaedit) to
'hi-jack' an existing unicode character that I don't expect ever
to use (in my case, 1488 - a Hebrew character) and turned it into
a tiny new character.  Then I replaced all no-break spaces with the
new character in my fo file.  FOP is able to render the new character
correctly but, because is is not visible under a zoom of less than
800%, it appears as a space!

A bit of a round-the-houses solution but effective - at least until
this strange bug is fixed.

-Original Message-
From: Doherty, Michael [mailto:[EMAIL PROTECTED]
Sent: 04 November 2002 12:53
To: '[EMAIL PROTECTED]'
Subject: no-break space in unicode font


I am producing pdfs that contain Japanese characters (among others).
Accordingly, I have created a font xml file from osaka.unicode.ttf to embed
in the pdf files.  This works (ie produces Japanese characters) but now I
find that no-break space characters (unicode 160 decimal; 00A0 in hex) are
not correctly handled.  I usually get the 'unkown' unicode character in
their place (a square outline) but sometimes get other, apparently unrelated
characters.

Has anybody else experienced something similar?  Are there any known
solutions?  Can the font be manipulated to solve the problem?

Any ideas would be greatly appreciated.

Many thanks,
Michael



--
This message is intended only for the personal and confidential use of the 
designated recipient(s) named above.  If you are not the intended recipient of 
this message you are hereby notified that any review, dissemination, 
distribution or copying of this message is strictly prohibited.  This 
communication is for information purposes only and should not be regarded as an 
offer to sell or as a solicitation of an offer to buy any financial product, an 
official confirmation of any transaction, or as an official statement of Lehman 
Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  
Therefore, we do not represent that this information is complete or accurate 
and it should not be relied upon as such.  All information is subject to change 
without notice.




Quark workflow

2002-11-05 Thread Joel Gwynn
Hello all.  I do variable data for a printing company.  I'm trying to
design a workflow as follows:

Quark template -> Quark XML -> [???] -> FOP -> PDF

How do I get from Quark XML to XSL-FO.  Also, I need a connection to
SQL-Server somewhere in there too, of course.

Thanks for helping a newbie.

Joel Gwynn
Variable Data
Spire
617 832-1957




Re: variable and svg

2002-11-05 Thread Paul Washinger

put braces around the variable when it is outside an xsl tag:

  



Re: Alternate table footer

2002-11-05 Thread Jordi Llonch
Well, if somebody are interesting in the solution I found that markers should 
be the solution. ;)

A Dimarts 05 Novembre 2002 11:22, Jordi Llonch va escriure:
> Hi,
>
> I am trying build an invoice and I need alternate table footer. When
> invoice doesn't end I want put a sentence in a footer and when invoice ends
> I want put a value.
>
> Any ideas would be greatly appreciated.
>
> Thanks,
>
> Jordi Llonch



Re: variable and svg

2002-11-05 Thread xavier gibouin



Hi
 
this is my code for genrate code barre from a  
number
 
http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format" 
xmlns:svg="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd"> 
 
  
 
  http://www.w3.org/2000/svg"> large 
noir http://www.w3.org/2000/svg"> 
 
  
 
   
but fop doesn't want assign the value of $x in 
"rec" tag
 
any ideas ??
 
thanks a lot
 
Xavier GibouinAxonieEspace Mercoeur8, rue Mercoeur44000 
Nantes02.40.48.53.23[EMAIL PROTECTED]


Re: xsl loop

2002-11-05 Thread Oleg Tkachenko
xavier gibouin wrote:
I would like to know if is it possible to realise à loop like :
for(index=0, index++, index<100) {
}
in xsl language 
Sure. As in any functional language you can do it using recursion,
e.g. see http://www.dpawson.co.uk/xsl/sect2/repetition.html
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


RE: xsl loop

2002-11-05 Thread Lihn, Steve



Here 
is a possible solution, use the recursive call-template.
 
      
    
  Do My Work Here 
...
              
      
  

  Steve Lihn 

-Original Message-From: xavier gibouin 
[mailto:[EMAIL PROTECTED]Sent: Tuesday, November 05, 2002 9:47 
AMTo: [EMAIL PROTECTED]Subject: Re:xsl 
loop

  Hi 
   
  I would like to know if is it possible to realise 
  à loop like :
   
  for(index=0, index++, index<100) 
{
   
   
  }
   
  in xsl language
   
  thanks a lot
   
   
  Xavier GibouinAxonieEspace Mercoeur8, rue Mercoeur44000 
  Nantes02.40.48.53.23[EMAIL PROTECTED]

--
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==



Re:xsl loop

2002-11-05 Thread xavier gibouin



Hi 
 
I would like to know if is it possible to realise à 
loop like :
 
for(index=0, index++, index<100) {
 
 
}
 
in xsl language
 
thanks a lot
 
 
Xavier GibouinAxonieEspace Mercoeur8, rue Mercoeur44000 
Nantes02.40.48.53.23[EMAIL PROTECTED]


Re: How to show PDF file in jsp page II.

2002-11-05 Thread Oleg Tkachenko
[EMAIL PROTECTED] wrote:
Yesterday, after a few good advices there from fop users I successfuly used
this code to show pdf content in browser. It works in my JDeveloper 9i.
File inputFile = new File(pdfFile);
FileReader fr = new FileReader(inputFile);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int ch;
while((ch = fr.read()) != -1) {
  baos.write(ch);
}
byte[] content = baos.toByteArray();
response.setContentType("application/pdf");
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();
Looks too convolute to me. If you have already created pdf file on a disk, why 
 do you process it by hands instead of rely on a web server? Just redirect 
browser to the file, that will emulate reading static pdf, which works okay 
even in IE (well, at least if extension is pdf).
I mean
response.sendRedirect("/foo/bar.pdf");

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


How to show PDF file in jsp page II.

2002-11-05 Thread Jiri_Nejedly
Yesterday, after a few good advices there from fop users I successfuly used
this code to show pdf content in browser. It works in my JDeveloper 9i.

File inputFile = new File(pdfFile);
FileReader fr = new FileReader(inputFile);

ByteArrayOutputStream baos = new ByteArrayOutputStream();
int ch;
while((ch = fr.read()) != -1) {
  baos.write(ch);
}

byte[] content = baos.toByteArray();
response.setContentType("application/pdf");
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();

---

But when I deploy my application to Tomcat (4.0.3, on same PC as browser),
browser shows dialog, asking whether to open or save the data. I can only
save it, open doesn't work. I use IE 6.0. I tried both GET and POST methods
with the same result.

Any ideas ?






Root element must be root, not (none):glossary

2002-11-05 Thread Deon van der Merwe
Hi All,

I searched the archive and found similar problems to this
one.  But the solutions do not work for me (for some reason).

Here is the error that I am getting:

2002-11-05 14:11:17,978 HttpProcessor[9081][3] ERROR root - Root element must 
be root, not (none):glossary
org.apache.fop.apps.FOPException: Root element must be root, not (none):glossary
at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source)
at 
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:575)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.apache.fop.apps.Driver.render(Unknown Source)
...

This is done with the standard "glossary" example that comes
with the FOP package.  When I run this from the command line, I
have no problems.  When I run it from inside a servlet, I get the
above error.

My example code:
try {
  org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver ();
  driver.setLogger(new org.apache.avalon.framework.logger.ConsoleLogger ());
  driver.setRenderer (org.apache.fop.apps.Driver.RENDER_PDF);
  org.apache.fop.apps.InputHandler inputHandler = new 
org.apache.fop.apps.XSLTInputHandler(new java.io.File 
("/home/dvdm/java/fop-0.20.4/docs/examples/markers/glossary.xml"), new 
java.io.File ("/home/dvdm/java/fop-0.20.4/docs/examples/markers/glossary.xsl"));
  org.xml.sax.XMLReader parser = inputHandler.getParser();
  driver.setOutputStream(new 
java.io.FileOutputStream("/home/dvdm/tmp/glossary.pdf"));
  driver.render(parser, inputHandler.getInputSource());
} catch (java.lang.Exception vException) {
  com.telimatrix.OutrixServer.mLogger.error (vException.getMessage (), 
vException);
}

I am using:
- fop-0.20.4
- jakarta-tomcat-4.0.1
- java version "1.3.0"
- Linux RedHat

Is there anyone that can help?




Re: breaking paragraphs and lines

2002-11-05 Thread Oleg Tkachenko
Stephen Haberman wrote:
2) Run this result through a text manipulation program to replace all of
the \n\n with  to simulate a paragraph break.
3) Run this result through FOP.
I'm thinking this will work once I get some scripts setup for it, but
I'm just wondering if there is a better, within-FO/FOP way?
Processing xml as text is kinda dangerous, especially when you are trying to 
fiddle with tags, I believe a better and more safe way is to handle \n\n stuff 
one stage earlier - during fo generation, that's pretty simple in xslt to 
tokenize string into blocks by any delimiter, trivial recursive template can 
do that.

Also, a subset of this problem is that I was wanting to have a little
bit of control over breaking from the XML file, e.g. force a line break.
E.g.:

   This is a long line that I want brokenhere.

Search in the archive - that's faq, you can use either  or unicode 
line separator (
).


  


  

Wrong way, disable-output-escaping implies serialization of a result tree 
hence doesn't work otherwise, e.g. in mozilla, cocoon and fop. This facility 
is for generating text (e.g. SQL), but not markup.

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


Alternate table footer

2002-11-05 Thread Jordi Llonch
Hi,

I am trying build an invoice and I need alternate table footer. When invoice 
doesn't end I want put a sentence in a footer and when invoice ends I want 
put a value.

Any ideas would be greatly appreciated.

Thanks,

Jordi Llonch



Re: OutOfMemoryError on Websphere, not in WSAD test environment

2002-11-05 Thread Davor Cengija

"Oleg Tkachenko" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Davor Cengija wrote:
> > We're creating some on the fly pdf files in WebSphere Application
Developer
> > (WSAD 4.0.3) and testing it in its internal WebSphere Test Environment.
> > Everything works just fine, and PDF files are created and displayed.
BTW,
> > its nothing too complicated, usualy single page with single table in it.
> >
> > However, on our real WebSphere Application Server v4.0.4, I'm getting
the
> > following error:
> >
> > [11/4/02 16:05:59:024 CST] 1cb7b002 WebGroup  X Servlet Error: :
> > java.lang.OutOfMemoryError
> > at
org.apache.fop.fonts.FontFileReader.init(FontFileReader.java:35)
> That allocates byte array for reading font file. Which fonts are you
using?
>

I'm using TTF files from Windows 2000, namelly Arial (all combinations of
slants and weights) and Lucida. Everything is fine on Windows, but on AIX
the error mentioned before appears.

FOP  is 0.20.3.

I'll try different fonts and FOP versions and let you know what happens.

Thanks.






breaking paragraphs and lines

2002-11-05 Thread Stephen Haberman
Hi,

After much debate between whether I'd pick up LaTeX or XML-FO as my
preferred environment for writing reports and the like, I went with
XML-FO, FOP specifically, and have been enjoying it so far (ah, clean
separate of data and presentation).

However, I've run into a small problem I thought some others might be
able to shed some light on.

One of the things I liked about LaTeX was that two newlines were taken
to mean separate paragraphs. As far as reproducing this before with FOP
using XML/XSLT is that I'd probably have to:

1) Use Xalan to stitch XML/XSLT together. All text blocks would be in
generic fo:blocks, e.g.:


  
text

text
  


2) Run this result through a text manipulation program to replace all of
the \n\n with  to simulate a paragraph break.

3) Run this result through FOP.

I'm thinking this will work once I get some scripts setup for it, but
I'm just wondering if there is a better, within-FO/FOP way?

Also, a subset of this problem is that I was wanting to have a little
bit of control over breaking from the XML file, e.g. force a line break.
E.g.:


   This is a long line that I want brokenhere.


So I was going to use the same approach of a double  to put
the text in, but then have a match against br and insert an artificial
block/inline-container type thing. The problem is that the match against
br has to look like:


  


  


With straight Xalan, the result is exactly what I want... the closing,
opening fo:block comes out in XML just like the previous opening
fo:block. However, FOP seems to ignore this
disable-output-escaping="yes" attribute and I see the literal
"" text in the PDF instead of it being interpreted
it as FO commands. If I run the result of Xalan on the same XML/XSLT
file through FOP via -fo, then it works great.

Any insight into either of the two issues I'm pondering would be greatly
appreciated. This is fun stuff.

Thanks,
Stephen