Re: Can FOP indent tables (say, with start-indent)?

2003-01-06 Thread Joerg Pietschmann
On Monday 06 January 2003 12:02, Graham Hannington wrote:
 Can FOP indent tables?
I don't think so.
Two simple workarounds
1. Use an additional column (without borders) for indentation, for example
  for a 2 column table indented by 6pt
  fo:table layout=fixed
 fo:table-column comlumn-width=6pt
 fo:table-column comlumn-width=5cm
 fo:table-column comlumn-width=5cm
 fo:table-body
fo:table-row
  fo:table-cell/
  fo:table-cell border=../fo:table-cell
  fo:table-cell border=../fo:table-cell
/fo:table-row
2. Put the table in another blind table with an additional column for
indentation similar to the point above.
Either approach has its merits.

 I'm using FOP 2.0.4.
Really?

J.Pietschmann

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



Re: Image border and page numbering issues

2003-01-05 Thread Joerg Pietschmann
On Sunday 05 January 2003 21:48, rakesh patel wrote:
 1. I have an external image within a block. I apply a
 border to the block but there's always a (1 pixel wide
 roughly) gap
 above and below the image.

Probably a bug. Add the border to the image instead as
a work around.

 a. the header to say page x of y. How to get y? (Total
 number of pages)
This is a FAQ, see
  http://xml.apache.org/fop/faq.html#faq-N10515

 b. The TOC to have start and end pages for each
 section? eg Page no 2-5 .. Chapter 1.
Same as above.

J.Pietschmann

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



Re: svg fills black when using variable

2003-01-03 Thread Joerg Pietschmann
On Friday 03 January 2003 01:00, you wrote:
 In the example below the rectangle is filled with black instead of
 limegreen. Is there a way to specify the fill color using a variable?
...
 xsl:variable name=color select=limegreen/
 svg:svg  height=400 width=400
 svg:rect  style=fill:{$color} height=50 width=100 /

If something wents wrong, run the transformation standalone
and examine the resulting file. in this case, you'd have seen
you probably generated
 svg:rect  style=fill: height=50 width=100 /
(no color)
The problem is here
 xsl:variable name=color select=limegreen/
This assigns the node set of limegreen child elements to
the variable, which is most probably empty, and not the string
'limegreen'. If you want to do the latter, use
 xsl:variable name=color select='limegreen'/
Read the XPath spec for details.

J.Pietschmann

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



Re: fop.jar with patches

2003-01-03 Thread Joerg Pietschmann
On Friday 03 January 2003 02:23, Peter B. West wrote:
 I'm deeply conservative about critical software like the repository.
 However, when (and if) the Apache repository goes to SubVersion, FOP may
 be obliged to go with it.
AFAIU there will be a choice, the CVS and SubVersion repositories
will run in parallel for quite some time.

  If there is a choice, I would be strongly in
 favour of staying with CVS for at least six months after other projects
 had gone over, so that they can suffer the pain.
I consider 6 month after the repository is up soon enough, although I
guess there will be an extended test time to check the operational
procedures (boot, backup, restore, failure modes), which may be part of
this 6 months.

 I would say that ready for production means that significant codebases
 have been maintained in SubVersion for long enough for the wrinkles to
 have appeared and been ironed out.
Well, SubVersion itself runs on SubVersion for some time now. I suppose
tigris.org will migrate right after 1.0 is out.

 How long was CVS around before gaining the level of acceptance it now
 enjoys?
CVS started as a directory tree oriented system on top of RCS with
a locally mounted filesystem as a repository. The network client/server
stuff was grafted on later, in response to popular demand and in
coevolution with the idea of public repositories accessible on the
internet. IIRC this started in late 1996 and it took well into 1998 to
squish major bugs and quirks and included some incompatible
network protocol changes. During this time it was already used
for major projects, according to the cvs lists. SourceForge started
somewhen in early 1999 with public CVS repositories.

SubVersion was designed as c/s system right from the start, mostly
in response to fix the deficiencies of CVS, in particular
- truly atomic commits (you don't want to know what happens if
  your network or, worse, the server goes down during a lengthy CVS
  commit)
- accessible through firewalls
- moving controlled files across directories
The real problem isn't that SubVersion could fail in situations where
CVS still works. The problem is the availability of client side tools,
specifically of GUI tools. That's not only an inconvenience for users
uncomfortable with command line applications, also only with the
availability of third party client side tools problems with protocol
conformance will be detected.

J.Pietschmann

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



Re: fop.jar with patches

2003-01-02 Thread Joerg Pietschmann
On Thursday 02 January 2003 15:55, Fabrizio Tringali wrote:
 OK, but I need the patched version for NullPointerException on
 Txt-Rendering bug

Oops!
Go to the mailing list archive, like
  http://marc.theaimsgroup.com
select the FOP cvs list, search the CVS commit diff which fixes the
problem and apply the patch by yourself.

J.Pietschmann

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



Re: Special Characters

2002-12-30 Thread Joerg Pietschmann
On Monday 30 December 2002 16:55, you wrote:
 My problem is that sometimes FOP creates an invalid PDF file
 because of a special character (such the Euro sign, for example).  Each
 time this happens, I look for that character in my code and replace it with
 an equivalent character or the Unicode representation.

 My question is, is there a known list of characters which will cause FOP to
 fail?

How do you define an invalid PDF file? Does Acrobat Reader refuse
to open such a file, does FOP raise an error or does the file just contain
an # or other unexpected glyphs?

Firstly, you should probably learn about character encodings in XML.
Each XML file starts with an XML declaration:
  ?xml version=1.0?
The declaration above means the file is UTF-8 encoded. You can't
for example edit this file with Windows Notepad and enter an Euro
sign (unless you have W2K or later and use save as UTF-8).
You can put an encoding into the XML declaration, like
  ?xml version=1.0 encoding=ISO-8859-1?
which means the file is ISO-8859-1 or Latin-1 encoded, the most
used character encoding. However, you still can't dit this file with
Windows Notepad and enter an Euro sign, because Windows usually
uses an extension of ISO-8859-1 called CP1252 or something similar,
and contrary to the example above, FOP will not catch this and simply
output a #.
If in doubt, restrict yourself to the ASCII character range and enter each
Unicode character outside this range as XML character reference. The
Euro sign is for example #x20AC; (including the semicolon). See
 http://www.unicode.org/charts/charindex.html
for a lookup table.
Alternatively, get an XML aware editor and use it exclusively.
Look also into the XML spec for more info:
  http://www.w3.org/TR/REC-xml

The second problem is that the standard fonts don't contain glyphs for most
Unicode characters. Helvetica (Arial), Times and Courier have only glyphs
for most of the characters from the ISO-8859-1 range (and a few characters 
outside this range), Symbol and Zapf Dingbats cover other ranges. See the
fonts.fo file in the FOP example directory tree for details. You can render
this file to PDF and see all characters supported out of the box. If there is
no glyph in the font for the required character, FOP uses # or the
equivalent in the font's encoding (it is some other glyph for the Symbol and
the Dingbat font).
For all other characters, you have to install a user font containing glyphs
for the characters you want to display. See docs/html-docs/font.html for more
info about this topic.

J.Pietschmann

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



Re: fop in tomcat-4.1.18 and struts-1.1-b2

2002-12-29 Thread Joerg Pietschmann
On Sunday 29 December 2002 04:57, you wrote:
 Struts, and FOP are all happy, except for this hopefully harmless
 exception as tomcat starts up:
...
 Parse Fatal Error at line 551 column 44: The string -- is not
 permitted within comments.
...
 Anyone know what file tomcat is complaining about?
It's complaining about a double dash inside an XML comment, which is not
allowed. Track down which file is parsed, and check the comment spanning
the line mentioned in the error message. The problem may be harmless, or
indicate something has been uncorrectly commented out, so that the
parsed content does not mathc the user's expectations. It's better to check.

 Apparently older versions of xerces or xalan
 or something is included in the java 1.4 rt.jar, and the xalan faq
 explains that this is one way to over-ride them.
Correct. Unfortunately, the Xalan coming with jdk 1.4 has a handful
of annoying bugs causing a lot of frustration. I hope the JDK bugfix
distribution will include Xalan 2.4.1.

J.Pietschmann

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



Re: Cross Post RE: DOCBOOK-APPS: screenshot and itemizedlist,top alignment in single row table

2002-12-28 Thread Joerg Pietschmann
On Friday 27 December 2002 09:32, you wrote:
 The FOP Web Site does list some limitations with Tables, but nothing about
 formatting lists in table cells. Perhaps, somebody on the FOP-USER list has
 experienced this problem and can give us a solution or pointer.

The problem is that FOP does not handle spaces conditionally,
as a poster in the snipped part already mentioned. It's not specific
to lists or tables.
The only solution is to avoid generating space-before/after properties
at places where they are not wanted. Of course this works only for table
cells, at page sequence boundaries and around forced breaks. There
is *no* solution for page breaks. And of course this complicates style
sheets.
This will not be fixed in the maintenance branch. It's not yet adressed
in the redesign either.

J.Pietschmann

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



Re: fop in tomcat-4.1.18 and struts-1.1-b2

2002-12-28 Thread Joerg Pietschmann
On Saturday 28 December 2002 13:04, you wrote:
 When I deploy my webapp, I get the exception below if I put the fop xml
 libs in my webapp's WEB-INF/lib dir.  Anyone know how to resolve this?
Ask on a Tomcat list. They are responsible for the classloader.

 I'm putting these files from fop 2.0.5rc in my lib dir.  If I don't put
 the fop xml libs there, my app deploys ok but I don't know if fop will
 work with the default tomcat 4.1.18 xml jars.

 xalan-2.4.1.jar
 xercesImpl-2.2.1.jar
 xml-apis.jar

It should work. Just try it. Make sure the Tomcat's XML parser is visible
to the webapps.

J.Pietschmann

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



Re: page-sequence

2002-12-28 Thread Joerg Pietschmann
On Thursday 26 December 2002 21:57, you wrote:
  1) Could somebody please share any sample xsl that would allow me to
 create multiple page-sequence?
  I have multiple tables with combined over 1,000 rows and I understand that
 I need to use multiple page-sequence per page to free up memory

Work yourself through a good XSLT book, and look into the XSLT
FAQ, reachable from here:
  http://www.mulberrytech.com/xsl/xsl-list/
The problem you probably have is called grouping by position.

J.Pietschmann

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



Re: fop recommendations on OS/390

2002-12-25 Thread Joerg Pietschmann
On Tuesday 24 December 2002 15:23, you wrote:
 I am looking for recommendations on whether my XML file as input to
 FOP should be EBCDIC or ASCII.  The application will be running as
 a servlet within WebSphere.I think either type of encoding could be
 made to work, but which would be best?
 We currently have a servlet creating an EBCDIC XML file as input to
 FOP processing.

There is no best.
Check:
- Do you have an XML parser which understands EBCDIC encoding
  (I'd think obviously, but then, your statement above might be bogus).
- Do you have to produce some input with a native OS/390 editor, which
  naturally produces EBDIC encoded files?
- Do you have to include data from non-mainframe platforms, which rarely
  produce EBDIC?
- What is the encoding of the strings in the database? Can this easily be
  changed?
- Do you have to produce serialized XML at all? If you use SAX or DOM
  in Java, everything is Unicode anyway.

If data manipulation with common mainframe tools is the exception
rather than the rule, I'd use ISO-8859-1 (western languages only), UTF-8
(east asian languages are insignificant) or UTF-16 (east asian languages
are significant) everywhere, including, and this is important, for storing
data in the DB.

J.Pietschmann

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



Re: supported image formats

2002-12-22 Thread Joerg Pietschmann
On Saturday 21 December 2002 21:54, you wrote:
 e.g. I
 use fop in a production under Websphere 3.5, which has ibm jsk 1.2.2 and
 jdk there btw is unupgradable.
That's not quite correct, we run a variety of WebSphere 3.5 on
AIX 4.3.x using both IBM JDK 1.3.0 and 1.3.1. Both the 1.3.0 JDK
and WebSphere itself need some patches, and unhandled
exceptions create memory leaks, so you'd better catch everything
in a production environment.

J.Pietschmann

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



Re: No handler defned for external graphic

2002-12-22 Thread Joerg Pietschmann
On Sunday 22 December 2002 12:35, you wrote:
 Thanks. Actually i was using centipede to create the pdf which was using
 forrest, which was using cocoon. So it was xml-xslt-fo-pdf.

Upgrade Xalan to the lates version, and you should see an error
message.

J.Pietschmann

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



Re: No handler defned for external graphic

2002-12-22 Thread Joerg Pietschmann
On Sunday 22 December 2002 14:04, you wrote:
 Do you mean the latest CVS? I tried with 2.4.1, same result (ie, correct
 result from command line, same error message via cocoon)

2.4.1 should be ok. Are you running on JDK 1.4? Check
if you really use your Xalan version with Cocoon. JDK 1.4
comes with an older, buggy Xalan version which is usually
loaded first. Ask the Cocoon gurus how to work around this.

J.Pietschmann

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



Re: No handler defned for external graphic

2002-12-21 Thread Joerg Pietschmann
On Saturday 21 December 2002 12:13, you wrote:
 I am using the the latest CVS version (tag fop-0_20_2-maintain), and
 have compiled it with both jimi and JAI enabled. However, i get the
 following error on fo:external-graphic
 src=file:///somepath/someimage.jpg /

 ERROR   (2002-12-21) 16:32.40:433   [sitemap] (Unknown-URI)
 Unknown-thread/FOTreeBuilder: Unknown formatting object ^external-graphic
 INFO(2002-12-21) 16:32.40:457   [sitemap] (Unknown-URI)
 Unknown-thread/PageSequence: [1]
 ERROR   (2002-12-21) 16:32.40:477   [sitemap] (Unknown-URI)
 Unknown-thread/UnknownXMLObj: no handler defined for :external-graphic
 foreign xml

The second error is caused by the first. The real problem is here:
  Unknown formatting object ^external-graphic
This means the external-graphic element is in the default namespace.
Usually this is in turn caused by not having the fo namespace declaration
in scope while generating the external-graphic element, like
  xsl:template match=/
fo:root xmlns:fo=http://www.w3.org/...;
  !-- fo namespace in scope here --
  ...
   xsl:apply-templates/
 ...
  /xsl:template
  xsl:template match=img
!-- fo namespace not in scope here --
fo:external-graphic src=@src/
  /xsl:template

Actually this shouldn't happen without you noticing before. Did you
write the FO file directly, or generated with the Xalan coming
with FOP? In the latter case, we might have hit another Xalan bug.

The simplest way to ensure the fo namespace declaration is in scope
is to move it to the xsl:stylesheet element.. If this doesn't work, run
the transformation standalone and check whether there is a xmlns:fo=
somewhere, this usually gives hints where you unassigned the
namespace in the style sheet.

J.Pietschmann

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



Re: Zip distribution files?

2002-03-21 Thread Joerg Pietschmann
[EMAIL PROTECTED] (Carlos) wrote:
 The issue has to do with incompatible
 line endings. If you try to run a tar.gz file on Windows it is likely to
 cause problems because of the line endings.

As already mentioned WinZip and many other compression utilities
can extract files from .tar.gz archives fine. Many of them are
also willing to do the linefeed conversion for you if asked,
check the online help or the manual for how to enable this.

Apart from this, it is not really necessary to do the conversion,
except for viewing the files in Notepad. You browser will display
the HTML files delivered in the distribution just fine without any
conversion, and FOP will work on the examples.

If you are worried about displaying the text files, use an
editor smart enough to do the right thing even if the file uses
Unix instead of Windows line end conventions. MS VisualStudio
is sufficient. Famous shareware editors like UltraEdit will work
too. Any XML aware editor will also work, by specification. The
real thing is Emacs, of course :-)

J.Pietschmann


Re: FAQ Answers please

2002-03-07 Thread Joerg Pietschmann
(Crossposted to both fop-dev and fop-user. fop-user subscribers, please
post follow-ups to fop-dev)

alex [EMAIL PROTECTED] wrote:
 Can anyone capture any important questions and answers which I should put
 into the FAQ?
Well questions are easy, answers somewhat less:

Here is my impression
1. FOP specific technical questions
 1.1 Using FOP in a servlet. Apparently, the servlet example in the
  distribution is not sufficient, but still a frist answer.
 1.2 Using FOP in a servlet with an XSLT transformation
  Many suboptimal answers are regulrly posted here and to the
  fop-user list.
  The canonical answers are, use XSLTInputHandler or TraxInputHandler
  if both XML and XSL are files, or a SAX event stream if some XML
  is generated on the fly or read from an network stream or such.
  Code can be copied from
   http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=xsltinputhandlerq=b
  namely
   http://marc.theaimsgroup.com/?l=fop-devm=101232320408992w=2
  and 
   http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=getContentHandlerq=b
  unfortunately, there are various neat snippets which would have to
  be combined in order to show all the possibilites.
   http://marc.theaimsgroup.com/?l=fop-devm=100583267306925w=2
   http://marc.theaimsgroup.com/?l=fop-devm=100703832007931w=2
 1.3 User supplied fonts
  While this is answered in the Docs, some expressive hints about what
  data are file names and what are file _URLs_ could be noted again.
 1.4 Embedding fonts when run from a servlet
  The usual code how to get the settings from userconfig.xml, as for
  example seen at
   http://marc.theaimsgroup.com/?l=fop-devm=101421597727050w=2
  This question needs to be indexed twice, obviously.
 1.5 Complaints about:
   1.5.1 files not found referenced in fo:external-graphics, user fonts etc.
   1.5.2 MalformedURLException, especially URIs starting with (null)
  It should be explained
   o The file names are URIs.
   o Users should be encouraged to get familar with URI syntax (quote
 web ressources, at least the RFCs).
   o The correct syntax for file URIs is file:///some/path/file.ext
 (on localhost, the usual case). Emphasize the triple slash.
   o The resolution mechanism for relative URIs should be explained,
 especially the role of baseDir.
   o Note that XSL transformations and JAXP transformers have their
 own mechanism for resolving relative URIs, could be redirected
 to the XSLT FAQ http://www.dpawson.co.uk/xsl/xslfaq.html
 1.6 Setting baseDir in userconfig.xml
 1.7 Setting baseDir in a servlet environment
  Either via userconfig.xml or the Configuration, code at
   http://marc.theaimsgroup.com/?l=fop-devm=101354604124258w=2
 1.8 New VFAQ: PNG images and other formats dont (no longer) work,
  Jimi library is missing
  Jimi is no longer in the distribution. Explain where to get it.
 1.9 NoClassDefFound (Command line)
  Explain again how to set the CLASSPATH. Explain the usage of the
  batch files and that they have to be started in the correct directory.
 1.10 NoClassDefFound (Servlet environment), getting FOP working
  for various servlet engines.
  Explain classpath issues, how jar files are gathered by various
  products, and possible conflicts with existing XML/XSLT libraries
  Subquestions
   o Tomcat 4
   o Tomcat 3
   o IBM Websphere
 Oh, i have this at hand:
Put a copy of a working parser in some directory where WebSphere can 
access
it,
for example, if /usr/webapps/yourapp/servlets is the classpath for your
servlets, copy the Xerces jar into it (any other direcotry would also 
be
fine)
Do not add the jar to the servlet classpath, but add it to the 
classpath
of the application server which contains your web application. In the
WebSphere
administration console, click on the environment button in the 
general
tab
(i have a german version so you may see different names). Fill 
CLASSPATH
in the varianble name box and 
/usr/webapps/yourapp/servlets/Xerces.jar
(or whatever your complete path is) in the value box, press OK, then
apply the change and restart the application server.
   o Others? The mail archive is not very responsive about this today.
 1.11 Method not found
  Explain possible incompatibilites (XML parsers, XSLT engines, Batik).
  Refer to previous question.
 1.12 FOP and multithreading
  FOP is not thread safe. Explain consequences.
 1.13 FOP memory consumption (should be higher in the list). 
OutOfMemoryException.
  Mention redesign effords
  Suggest using multiple page sequences if possible
2. Batik/SVG specific questions
 2.1 SVG text rendered in bad quality, how to put SVG text as text into PDF
  That's here
   http://marc.theaimsgroup.com/?l=fop-devm=100525846132084w=2
  Refer also to how to use userconfig in servlets
 2.2. Batik on headless servers
  Refer to Xvfb and PJA 
   http://marc.theaimsgroup.com/?l=fop-devm=101481782018662w=2
 2.3. FOP does not exit if 

Re: sax conflicts with tomcat-4.0.2-LE-jdk1.4

2002-02-12 Thread Joerg Pietschmann
Jeremias Maerki [EMAIL PROTECTED] wrote:
 The only place where Xerces is directly imported is the PFMReader and
 TTFReader. Ok, Driver, when startet using the command line, uses Xerces
 by default, but nothing prevents you from using any JAXP parser with FOP.

Stuff matching org.apache.x* in 0.20.2:
...Driver.java
  parserClassName = org.apache.xerces.parsers.SAXParser;
...PFMReader.java
  org.apache.xerces.dom.*;
  org.apache.xml.serialize.*;
  org.apache.xalan.xslt.*;
...TTFReader.java
  dto.
...fop.layout.hyphenation.PatternParser.java
  parserClassName = org.apache.xerces.parsers.SAXParser;
...fop.tools.anttasks.CompileXMLFiles.java
  parserClassName = org.apache.xerces.parsers.SAXParser;
...fop.tools.xslt.Xalan1Transform.java
  org.apache.xalan.xslt.*;
...fop.tools.xslt.XSLTransform.java
  Class.forName(org.apache.xalan.xslt.XSLTProcessor);

I believe all this stuff could be replaced by JAXP 1.1 standard
functionality. This means FOP could also be build with any JAXP
1.1 compatible XML/XSL library.
This would also get rid of some unfortunate dependencies from
Driver.getParserClassName() (why not use
  SAXParserFactory.newSAXParser().getXMLReader()
instead and let the library handle all the annoying stuff? At
the same time, validation could be switched off, gaining some
performance in rare cases).
I could try to prepare patches, however:
- Is there a chance to get them into the maintenance branch?
  (there is a feature freeze pending, AFAIK)
- Last time i tried i was not able to build FOP successfully,
  because of an odd ant incompatibility problem i didn't (and
  still don't) have time to resolve. This means i can only try
  basic compilation, someone else would have to finalize the
  patch.


(Crossposted to fop-dev)

Regards
J.Pietschmann


RE: Entity references in FOP

2002-02-11 Thread Joerg Pietschmann
Arved Sandstrom [EMAIL PROTECTED] wrote:
 The entity references are a side issue. If you are going to use validation
 then you must describe the entire XML vocabulary, because that is the
 meaning of valid.

That's correct, however, even non-validating parsers are required to
read and respect an internal DTD subset (with some caveats, see
http://www.w3.org/TR/2000/REC-xml-20001006#proc-types).
If the parser doesn't validate, the given XML perfectly works, I tried
it myself several times with Saxon.
The interesting question is: how do i turn off validation for Xerces
if invoked by FOP? I could use
  parser.setFeature(http://xml.org/sax/features/validation,false);
from Java code, but is there a way to do this via the command line,
a system property or an entry in userconfig.xml? A quick glance both
at the FOP and the Xerces code revealed nothing..
Meanwhile, i helped myself by putting Saxon in the class path instead
of Xerces/Xalan, and use
  -Dorg.xml.sax.parser=com.icl.saxon.aelfred.SAXDriver

Regards
J.Pietschmann


RE: FOPException

2002-02-08 Thread Joerg Pietschmann
Xie, David (IPCG-NJ) [EMAIL PROTECTED] wrote:
 I am running FOP 0.20.1.  The strange thing is when I ran one
 or two FOP servlets embed from my browser everything works fine.
  However, when I send many requests, sometime I get errors such as
 FOPException, connection reset by peer:socket write error and
 Connection aborted by peer:socket write error. 

This is most likely caused by browsers timing out, in rare circumstances
by network congestion. It could help to run the server on a bigger machine.
Unfortunately, FOP is not thread safe and therefore can't easily take
advantage of MP machines.

 This really worries me, because eventually this application would
 take more than 20,000 hits per week.

If this is distributed over 5 days nine-to-five, it's roughly one hit
every 6 seconds. If your servlet takes more than that on average,
you'll have to investigate in caching and/or setting up multiple
server processes with load balancing. You might want to evaluate
Cocoon for its caching abilities (FOP is already build in there).

Regards
J.Pietschmann


Re: ERROR in server

2002-02-07 Thread Joerg Pietschmann
Pedro Barco Bernal [EMAIL PROTECTED] wrote:
 My code is placed in a JSP and i do not know why it doesn´t run fine.
 The error i get is: org.apache.fop.apps.FOPException: Bad file
 descriptor but i´m sure that the xml and xsl are well-formed...

This is a somewhat rare and obscure I/O error reported by the
underlying OS. No amount of fiddling with the XML/XSL is likely
to fix this.

There may be any number of reasons: a likely one is that the file
is prematurely closed by another thread, but there may be others
ranging from insufficient access rights and file locks to temporary
network congestion.

This is actually not a FOP question. Get hold of the system administrator
of the system where this happens and perhaps some other local gurus
and ask them to fix this. If you are using a commercial product
(you seem to use ORACLE), asking their tech support could also
be a good idea.

 writefile.createNewFile();
You can take a first shot by deleting this line and trying again,
unless you really want to keep old PDF files (read the documentation
of this function carefully).

J.Pietschmann


Re: FOPException: no protocol (embedded in servlet)

2002-02-04 Thread Joerg Pietschmann
Sebastian Will [EMAIL PROTECTED] wrote:
 Your help is much appreciated. I searched through the available archives
 (most of them seem to be down),
 but I cannot find some better way to implement a
 convert-xml-to-fo-with-xsl-and-render-that-without-writing-to-FS
 rendering.

That's odd.
Since Version 0.20.x or something, FOP is delivered with a XSLTInputHandler
class. Look it up in the documentation, or in the archive:
 http://marc.theaimsgroup.com/?l=fop-devw=2r=1s=XSLTInputHandler%28q=b
If you are sure your XSLT processor supports SAXResults (Xalan does), you
can use a TraxInputHandler directly.

Unfortunately, both XSLTInputHandler and TraxInputHandler take only files,
both for the XML source and the XSLT. This is bad if you get character
streams, SAX streams or DOM trees from elsewhere (e.g. from a DB or a web
service). In this case you can use a SAX event stream to get the
transformation result into FOP, roughly like this:

 // however you want to set up your transformation
 Transformer 
transformer=TransformerFactory.newInstance().newTransformer(xsltSource);
 // prepare FOP
 Driver driver=new Driver();
 driver.setOutputStream(...);
 driver.setRenderer(RENDER_PDF);
 transformer.transform(xmlSource, new SAXResult(driver.getContentHandler()));

The above is slightly simplified and untested.
You don't have to call driver.render() or run(), as the rendering is
driven by the SAX stream coming from the transformation. Note that the FOP
output stream and the renderer has to be set before getContentHandler()
is called.

Regards
J.Pietschmann


Re: FOPException: no protocol (embedded in servlet)

2002-01-31 Thread Joerg Pietschmann
[EMAIL PROTECTED] wrote:
 I get a FOPException while processing a XSL-FO with Fop-0.20.3rc.
 For testing I'm transforming a xml document into xsl-fo ...

 javax.servlet.ServletException: FOPException: no protocol:
 ?xml version=1.0 encoding=iso-8859-1?
 fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

The message tells: You feed the result of the transformation
as a string to a place where the underlying mechanism expects
an URL.

 /** Durchführen der Transformation, Ergebnis in ein File wegschreiben.
  */
 StringWriter sw = new StringWriter();
 transformer.transform(xmlStreamSource,new StreamResult(sw));

There is a blatant mismatch between the comment and the
code. The result is not written to a file but to a string
in memory...

renderFO(new InputSource(sw.toString()),

...which in turn is passed to the InputSource where it expects
an URL.

Lesson: Have only programmers with a clue fiddle with the code.

Search the Web or better the mailing list archives for fop-user
and fop-dev for how to wire an XSL transformer properly to FOP.
Unfortunately, the Servlet example delivered with FOP is a bit
outdated.

J.Pietschmann


Re: Entity references in FOP

2002-01-29 Thread Joerg Pietschmann
David Wood [EMAIL PROTECTED] wrote:
 I would be curious to find a list of what entities are in and what aren't.
 Also, I presume I can use a numeric code (#number; - or amp;#number;) to
 reference the character directly. However, it seems like a list of those
 numbers and their corresponding characters is a little too basic for the
 FOP documentation or the usual reference materials. I assume there's a
 relevant ISO document - anybody know what it is?

The relevant standards bodies are the Unicode Consortium and the W3C.

The authoritative mapping of HTML entity names to their character
code is at  http://www.w3.org/TR/html4/sgml/entities.html
You can cutpaste the character entites directly from that page.
There may be other ressources which are more comfortable to use,
look at http://www.zvon.org for example.

The Unicode character index starts at
  http://www.unicode.org/charts/charindex.html
They use hexadecimal numbers, use them like #xpaste here;
Do not use amp;#whatever, this will be shown as #whatever;
in your result. You might want to read the XML spec for details,
  http://www.w3.org/TR/2000/REC-xml-20001006#sec-references

Of course, whether the characters are displayed correctly depends
on the fonts installed for FOP, the font selected, and perhaps
the fonts installed on the machine where the resulting PDF is
finally viewed. Whether a HTML entity is defined for a particular
is irrelevant.

HTH
J.Pietschmann


Re: multiple output files

2002-01-29 Thread Joerg Pietschmann
Matthew L. Avizinis [EMAIL PROTECTED] wrote:
   A whole lotta help needed please:  I need to write to a file all the 1)
 page-number-citations page numbers along with their corresponding ref-id's
 also the 2) last page of the pdf file being currently generated by FOP along
 with it's corresponding file name.

Odd subject for these questions. However, look at
  http://marc.theaimsgroup.com/?l=fop-devm=100747811203665w=2
and decide whether this helps you. In any case, i can't see
how you can achieve your goal without fiddling with FOP internals.
You might also want to educate yourself about how to write FOP
extension functions. There is a brief intro in 
 docs/html-docs/extensions.html
in your FOP distribution.

HTH
J.Pietschmann