Re: Chinese hyphenation particularity

2006-03-07 Thread Nicolas Lalevee
Jeremias Maerki a écrit :
 There's not much else you can do other than to try to handle/work-around
 everything in XSLT. FOP does not have special code to handle languages
 like Chinese. We lack the knowledge set in the project team. Every now
 and then we talk about implementing UAX#14 line breaking but so far
 nobody had the resources to dive into this. Any help is welcome.

OK,
In fact, I haven't find any formatter that does that. XSL Formatter
doesn't support that (said the Antenna House support), no answer yet of
XEP support.
So the only way to do a such hyphenation is to code it myself in FOP. So
maybe I will be involved in that stuff, depending of the work to do.
Can I have more info about the UAX#14 ?

bye,
Nicolas

 
 On 06.03.2006 10:48:24 Nicolas Lalevee wrote:
 
Hi everybody,

I have succeeded in producing a chinese PDF from an XML document via a
XSL transformation.
There is a last problem. The professional chinese document should not
let a chinese character alone on a line.
For instance, I have the sentense AZERTYUIO. to render in PDF. FOP
(with the patch of the bug 36977 for the trunk version), generate a PDF
with :
AZERTYUI
O.

And, for chinese people, that's not a well rendered document. The
prefered layout is :
AZERTYUIO. (the characters have to be compressed)
or
AZERTYU (the characters have to be expanded)
IO.

The only way I found to do so is to force the last three characters of a
text to be no-wrap. Here is my XSL template :

xsl:template match=text()
xsl:variable name=txt
xsl:call-template name=string.subst
xsl:with-param name=string
xsl:call-template name=string.subst
xsl:with-param name=string
xsl:call-template name=string.subst
xsl:with-param name=string select=. /
xsl:with-param name=target
select='.' /
xsl:with-param name=replacement
select='.#x200B;' /
/xsl:call-template
/xsl:with-param
xsl:with-param name=target select='\' /
xsl:with-param name=replacement
select='\#x200B;' /
/xsl:call-template
/xsl:with-param
xsl:with-param name=target select='/' /
xsl:with-param name=replacement select='/#x200B;' /
/xsl:call-template
/xsl:variable
xsl:choose
xsl:when test=string-length($txt)  3
xsl:value-of select=substring($txt, 1,
string-length($txt)-3) /
fo:inline wrap-option=no-wrap hyphenate=false
keep-together.within-line=always
xsl:value-of select=substring($txt,
string-length($txt)-2, string-length($txt)) /
/fo:inline
/xsl:when
xsl:otherwise
xsl:value-of select=$txt /
/xsl:otherwise
/xsl:choose
/xsl:template

And that's a not good solution because some ends of line can be missed.
In my XML source document, I can have inline formatting properties, like
bold or italic, that makes the text sequence shorter than 3, even if the
complete sentense contains more than 3 characters.

Is there any other way to handle this hyphenation particularity ?

Thanks in advance
Nicolas
 
 
 
 Jeremias Maerki


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



Re: Chinese hyphenation particularity

2006-03-07 Thread Jeremias Maerki
UAX#14 is specified here:
http://www.unicode.org/reports/tr14/

If you're serious about diving into this, keep in mind that this is
probably not a small job and will require some amount of getting
acquainted with FOP and its innards. It's also recommended that you
subscribe to the fop-dev mailing list and that you browse through the
mailing list archive for the fop-dev mailing list where you will find
some discussions and preparational work already done (mostly by Joerg
Pietschmann). Search words are UAX, UAX#14, Unicode, TR14, i18n,
line breaking. We were recently talking about using ICU4J
(http://icu.sourceforge.net/). Its use may give us a good head-start.
Joerg Pietschmann and Manuel Mall already did some work in the area:
http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200510.mbox/[EMAIL 
PROTECTED]

I can't help much here because I haven't had the time to get a closer
look at all this.

On 07.03.2006 09:11:47 Nicolas Lalevee wrote:
 Jeremias Maerki a écrit :
  There's not much else you can do other than to try to handle/work-around
  everything in XSLT. FOP does not have special code to handle languages
  like Chinese. We lack the knowledge set in the project team. Every now
  and then we talk about implementing UAX#14 line breaking but so far
  nobody had the resources to dive into this. Any help is welcome.
 
 OK,
 In fact, I haven't find any formatter that does that. XSL Formatter
 doesn't support that (said the Antenna House support), no answer yet of
 XEP support.
 So the only way to do a such hyphenation is to code it myself in FOP. So
 maybe I will be involved in that stuff, depending of the work to do.
 Can I have more info about the UAX#14 ?
 
 bye,
 Nicolas
 
  
  On 06.03.2006 10:48:24 Nicolas Lalevee wrote:
  
 Hi everybody,
 
 I have succeeded in producing a chinese PDF from an XML document via a
 XSL transformation.
 There is a last problem. The professional chinese document should not
 let a chinese character alone on a line.
 For instance, I have the sentense AZERTYUIO. to render in PDF. FOP
 (with the patch of the bug 36977 for the trunk version), generate a PDF
 with :
 AZERTYUI
 O.
 
 And, for chinese people, that's not a well rendered document. The
 prefered layout is :
 AZERTYUIO. (the characters have to be compressed)
 or
 AZERTYU (the characters have to be expanded)
 IO.
 
 The only way I found to do so is to force the last three characters of a
 text to be no-wrap. Here is my XSL template :
 
 xsl:template match=text()
 xsl:variable name=txt
 xsl:call-template name=string.subst
 xsl:with-param name=string
 xsl:call-template name=string.subst
 xsl:with-param name=string
 xsl:call-template name=string.subst
 xsl:with-param name=string select=. /
 xsl:with-param name=target
 select='.' /
 xsl:with-param name=replacement
 select='.#x200B;' /
 /xsl:call-template
 /xsl:with-param
 xsl:with-param name=target select='\' /
 xsl:with-param name=replacement
 select='\#x200B;' /
 /xsl:call-template
 /xsl:with-param
 xsl:with-param name=target select='/' /
 xsl:with-param name=replacement select='/#x200B;' /
 /xsl:call-template
 /xsl:variable
 xsl:choose
 xsl:when test=string-length($txt)  3
 xsl:value-of select=substring($txt, 1,
 string-length($txt)-3) /
 fo:inline wrap-option=no-wrap hyphenate=false
 keep-together.within-line=always
 xsl:value-of select=substring($txt,
 string-length($txt)-2, string-length($txt)) /
 /fo:inline
 /xsl:when
 xsl:otherwise
 xsl:value-of select=$txt /
 /xsl:otherwise
 /xsl:choose
 /xsl:template
 
 And that's a not good solution because some ends of line can be missed.
 In my XML source document, I can have inline formatting properties, like
 bold or italic, that makes the text sequence shorter than 3, even if the
 complete sentense contains more than 3 characters.
 
 Is there any other way to handle this hyphenation particularity ?
 
 Thanks in advance
 Nicolas
  
  
  
  Jeremias Maerki


Jeremias Maerki


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



Hello, about fop

2006-03-07 Thread chinlu chinawa
Hi guys,

I've been around the installation of trunk's version of FOP, which I've
ended up by not being able to use beacuse of my system is too old
(libc-2.2, gcc 2.95.3), and the java version you've lately updated to,
doesn't run here.

Actually, the only version I'd able to use, would be 0.20.5. The thing
is this version doesn't respect my custom footers (the body overrides
it), body text doesn't start neither at the same possition when using
this footers, etc.

So I'm just wondering whether could anyone please tell about other resources? 

I'd like to be able to generate nice-looking documents, I mean with svg
or anyother scalable imaging format, etc. For this time, I'll be
publishing in C5 (paper size), don't know whether this would a problem
or not.

I understand dockbook/XML-XSLT/SGML-DSSSL and it's customization layers
as a good way of working, although I'd like an expert to advise me. 

I'd be working on a pdf output basis or any other format that would be
better for a press to work with. I'm within a linux system, and have no
troubles at all when starting to learn all over again, tex or any other
format any one could advise me as the most proffesional one when
dealing with presses (is that how you call those places that actually
print out your book, isn't it?), sorry my english anyway. 

I've been for a while away from any of this, but I do remember there
are formats such as dvi, postscript, I know one can have pdf from sgml
+ jadetex, that one can use it even with dsssl or xslt style-sheets
(IIRC). 

I'd really appreciate, though, if someone could advise when getting
into something that's gonna be stable, robust, and is not gonna break
any of my work beacuse of thirdy-party dependencies, whilst being able
to generate good-looking documents as well as dealing with presses, or
printing-presses at highest level.

Kind Regards,




Antwort: Re: Antwort: Re: Changing logging behavior in an embedded application.

2006-03-07 Thread Eckard_Buchner

i could do something like this: Add
a parameter -v (verbose) and doing system.out only when this parameter
is set. Additionally there would be a boolean property, because when I
embed the reader I do not use the main() method. Do you agree?

Eckard






Jeremias Maerki [EMAIL PROTECTED]

07.03.2006 08:45



Bitte antworten an
fop-users@xmlgraphics.apache.org





An
fop-users@xmlgraphics.apache.org


Kopie



Thema
Re: Antwort: Re: Changing logging behavior
in an embedded application.








You're welcome to improve TTFReader in FOP Trunk if
it doesn't do
exactly what you want it to do. TTFReader was never designed to be used
as anything else than a command-line tool which is called once for each
font. If people have additional needs we're gladly accepting patches
against FOP Trunk.

On 07.03.2006 08:23:56 Eckard_Buchner wrote:
  FOP does have a few System.out.println calls in its source code
but
  these are only in places where those are ok, i.e. in command-line
  handling code
 
 IMHO this is not the case with the TTFReader. It tells you about each
file 
 it reads and writes. If you convert a couple of files at once this
is a 
 little inconvenient. Maybe it should have a silent mode? BTW if you
embed 
 the TTF Reader i would prefer getting exceptions when something goes
wrong 
 rather than geting null return (and a stack trace in stdout)

snip/


Jeremias Maerki


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




Re: Hello, about fop

2006-03-07 Thread chinlu chinawa
Well, I got both jdk, and jre installed (1_3_1_17), I
mean, the did decompress.

They need at least glibc-2.2.4, whilst mine is 2.2.1.
Could not even build fop because of this, therefore
there's no way it would run either, so I got rid of
all.

I wouldn't say this is any odd problem at all, but a
simple glibc dependency issue, though. 

My compiler and glibc are a bit older, as in my
opninion, nobody needs a glibc eating a hundred more
megabytes of memory after each release, and I can
compile new applications as they come out (and I need
them), but the rest of my system is up to date, and
haven't had any problem I couldn't solve. 

Anyway, I've only used java because of fop, and is
just that we don't need to, this is unix.

Ahm, yes I'm sure that 0.91 is a proper production
tool, but I cannot say same of 0.20.5. It's alright
for simple documents, though. But when you start
dealing with tables, or footers or headers, and you
need precision, there's no way, or that's been my
experience.

Well, you didn't point out me anywhere, I've been
reading about tex, and it looks quite powerfull and
robust, I whish I would have started with it from the
begining, so I'll do it now.

Best Regards guys,




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com

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



Re: Antwort: Re: Antwort: Re: Changing logging behavior in an embedded application.

2006-03-07 Thread Jeremias Maerki
If the TTFReader is supposed to be used as an embedded component, it's
best to separate the logic from the command-line interface. System.out
calls would then not be permitted in the logic, only in the command-line
interface. I don't like when things are mixed. I've just had a look at
the code and as far as I can see, all log calls go to the logger, so it
would actually be only a matter of setting up the logging right in your
case. You may not even have to change anything. I did not remember that
the whole thing was so well cleaned-up already.

On 07.03.2006 10:06:31 Eckard_Buchner wrote:
 i could do something like this: Add a parameter -v (verbose) and doing 
 system.out only when this parameter is set. Additionally there would be a 
 boolean property, because when I embed the reader I do not use the main() 
 method. Do you agree?
 
 Eckard
 
 
 
 
 Jeremias Maerki [EMAIL PROTECTED] 
 07.03.2006 08:45
 Bitte antworten an
 fop-users@xmlgraphics.apache.org
 
 
 An
 fop-users@xmlgraphics.apache.org
 Kopie
 
 Thema
 Re: Antwort: Re: Changing logging behavior in an embedded application.
 
 
 
 
 
 
 You're welcome to improve TTFReader in FOP Trunk if it doesn't do
 exactly what you want it to do. TTFReader was never designed to be used
 as anything else than a command-line tool which is called once for each
 font. If people have additional needs we're gladly accepting patches
 against FOP Trunk.
 
 On 07.03.2006 08:23:56 Eckard_Buchner wrote:
   FOP does have a few System.out.println calls in its source code but
   these are only in places where those are ok, i.e. in command-line
   handling code
  
  IMHO this is not the case with the TTFReader. It tells you about each 
 file 
  it reads and writes. If you convert a couple of files at once this is a 
  little inconvenient. Maybe it should have a silent mode? BTW if you 
 embed 
  the TTF Reader i would prefer getting exceptions when something goes 
 wrong 
  rather than geting null return (and a stack trace in stdout)
 
 snip/


Jeremias Maerki


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



Re: Changing logging behavior in an embedded application.

2006-03-07 Thread Eckard_Buchner

you are right the trunk version is fine.
I am still using the 0.20 version but I will soon upgrade
Eckard






Jeremias Maerki [EMAIL PROTECTED]

07.03.2006 10:17



Bitte antworten an
fop-users@xmlgraphics.apache.org





An
fop-users@xmlgraphics.apache.org


Kopie



Thema
Re: Antwort: Re: Antwort: Re: Changing
logging behavior in an embedded application.








If the TTFReader is supposed to be used as an embedded
component, it's
best to separate the logic from the command-line interface. System.out
calls would then not be permitted in the logic, only in the command-line
interface. I don't like when things are mixed. I've just had a look at
the code and as far as I can see, all log calls go to the logger, so it
would actually be only a matter of setting up the logging right in your
case. You may not even have to change anything. I did not remember that
the whole thing was so well cleaned-up already.

On 07.03.2006 10:06:31 Eckard_Buchner wrote:
 i could do something like this: Add a parameter -v (verbose) and doing

 system.out only when this parameter is set. Additionally there would
be a 
 boolean property, because when I embed the reader I do not use the
main() 
 method. Do you agree?
 
 Eckard
 
 
 
 
 Jeremias Maerki [EMAIL PROTECTED] 
 07.03.2006 08:45
 Bitte antworten an
 fop-users@xmlgraphics.apache.org
 
 
 An
 fop-users@xmlgraphics.apache.org
 Kopie
 
 Thema
 Re: Antwort: Re: Changing logging behavior in an embedded application.
 
 
 
 
 
 
 You're welcome to improve TTFReader in FOP Trunk if it doesn't do
 exactly what you want it to do. TTFReader was never designed to be
used
 as anything else than a command-line tool which is called once for
each
 font. If people have additional needs we're gladly accepting patches
 against FOP Trunk.
 
 On 07.03.2006 08:23:56 Eckard_Buchner wrote:
   FOP does have a few System.out.println calls in its source
code but
   these are only in places where those are ok, i.e. in command-line
   handling code
  
  IMHO this is not the case with the TTFReader. It tells you about
each 
 file 
  it reads and writes. If you convert a couple of files at once
this is a 
  little inconvenient. Maybe it should have a silent mode? BTW
if you 
 embed 
  the TTF Reader i would prefer getting exceptions when something
goes 
 wrong 
  rather than geting null return (and a stack trace in stdout)
 
 snip/


Jeremias Maerki


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




Re: page sequencing for parallel print

2006-03-07 Thread Jeremias Maerki
Partially. We've already implemented the bookmark feature in 0.91beta.
Other features will be added as people invest effort into FOP.

On 07.03.2006 11:33:11 Christiane Fritze wrote:
 Will the next FOP follow the new XSL 1.1 candidate recommendation?


Jeremias Maerki


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



Fonts

2006-03-07 Thread Andreia Oliveira



Hi. I am a newbie in 
FOP and I am struggling with a question regarding fonts.

I inherited a 
project from a colleague and I am a bit lost.

We want to generate 
pdf files. For that, currently (and until we have a complete database structure 
built / and the .net engine that will generate these pdf files), we are doing 
some tests to understand if we will be able to generate the files as requested 
using fop.

An xml file, a xsd 
and a xslt were created.
The xml file has a 
special tag that we called XMLContent because it will contain tags like 
strong and em inside the text. 
(Example: 
field1Here is my text. It will be strongdifficult/strong 
to get it emformatted/em 
correctly/field1)
The xsd defined the 
proper fields as being of type XMLContent: 


  xs:element name="field1" 
  type="um:XMLContent"/
The xslt has a 
section were it tries to handle these xml tags.

  xsl:template 
  name="XMLContent"
  xsl:apply-templates 
  select="node()" /
  xsl:value-of select="text()" 
  /
  /xsl:template
  xsl:template match="//em/text() | //strong/text()"
  fo:inline
  xsl:if test="ancestor::em"
  xsl:attribute name="color"rgb(0,255,0)/xsl:attribute
  /xsl:if
  xsl:if test="ancestor::strong"
  xsl:attribute name="font-weight"bold/xsl:attribute
  /xsl:if
  xsl:value-of select="."/
  /fo:inline
  /xsl:template
But, when I try to 
generate the pdf (using command line), the tags are completely ignored (no text 
is output in bold or italic)
Also, in the log fop 
generates on the screen it does not return any error regarding the fonts. It 
outputs "[INFO] setting up fonts" and continues...

Can someone 
help?

Thanks,

--
Andreia Oliveira
[EMAIL PROTECTED]
---



Re: Hello, about fop

2006-03-07 Thread b . ohnsorg

- original Nachricht 

Betreff: Hello, about fop
Gesendet: Mo 06 Mär 2006 23:39:57 CET
Von: chinlu chinawa[EMAIL PROTECTED]

 I understand dockbook/XML-XSLT/SGML-DSSSL and it's
 customization layers as a good way of working,
 although I'd like an expert to advise me.

http://www.sagehill.net/docbookxsl/index.html

 I'd be working on a pdf output basis or any other
 format that would be better for a press to work with.
 I'm within a linux system, and have no troubles at all
 when starting to learn all over again, tex or any
 other format any one could advise me as the most
 proffesional one when dealing with presses (is that
 how you call those places that actually print out your
 book, isn't it?), sorry my english anyway.

Dunno what this all about, I only use fop 0.91, even on a HP-UX 11 and I also 
rendered fancy svg into PDF-outputs. My only advice would be: 
OpenOffice-Export As «SVG»-insert into FO (or docbook-resource, have a look 
at the mediaobject) and run fop. Maybe it's not the right way to design 
flyers and graphical complex structures. Therefore leave the fo-step and export 
directly from OpenOffice...(if it runs on your box, at all). TeX and LaTeX is a 
bit more complicated, try starting with LyX, if it compiles/runs on your 
glibc-whatever *g*









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



RE: Fonts

2006-03-07 Thread Andreia Oliveira
I proceeded as suggested.
The fo file generated by step 1 has no reference to the strong or em
elements.
Proceeded to step two and final pdf file was not generated as supposed. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: terça-feira, 7 de Março de 2006 13:02
To: fop-users@xmlgraphics.apache.org
Subject: Re: Fonts


- original Nachricht 

Betreff: Fonts
Gesendet: Di 07 Mär 2006 13:42:47 CET
Von: Andreia Oliveira[EMAIL PROTECTED]
[...]
 pdf (using command line), the tags are completely ignored (no text is
output in bold or italic)Also, in the log fop generates on the screen it
does not return any error regarding the fonts. It outputs [INFO] setting up
fonts and continues... Can someone help? 

Did you check your transformation without FOP, e.g. take an extra step to
see, if the FO contains the font-formatting attributes?

1. XML-XSLT-FO (xstlproc, xalan, saxon...) 2. FO-FOP-PDF (FOP)

Thanks, --Andreia
[EMAIL PROTECTED] 

--- original Nachricht Ende 




Ihr Traumpartner ist nur einen Klick entfernt. 1 Million Singles warten auf
Sie in Deutschlands beliebtester Partnerboerse:
http://singles.freenet.de/index.html?pid=11512


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


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



RE: Fonts

2006-03-07 Thread Andreia Oliveira
Hi.
This new approach was attempted (separate templates as suggested).
The result is the text inside field1 is not touched at all (as before). It
remains as before without any tranformation.
It seems to me that fop is not even applying the template despite the fact
that the xml file as references to em and strong elements.

Maybe I did not explain myself clearly about my purpose:
Inside one XML field  (fo:block) some em and strong tags may appear.
If so, fop, when generating the should generate the text inside the em and
strong tags in italic and bold.

Is this the correct approach for this process?

-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED] 
Sent: terça-feira, 7 de Março de 2006 15:15
To: fop-users@xmlgraphics.apache.org
Subject: Re: Fonts

Andreia Oliveira wrote:
...
 An xml file, a xsd and a xslt were created.
Fortunately, schema definitions (XSD) are irrelevant for FOP.

 (Example: field1Here is my text. It will be 
 strongdifficult/strong to get it emformatted/em 
 correctly/field1)

 xsl:template name=XMLContent
This matches elements with the name XMLContent. There are no such elements
in your source file, because XMLContent is a *type*, therefore this template
never triggered. In you case this makes not much of a difference, because
you basically want the default template behaviour anyway.
You can't match types unless you are using a XSLT2 processor.

 xsl:apply-templates select=node() / xsl:value-of select=text() 
 /
^
This will duplicate the first text node of the element, because all child
nodes (including all text nodes) have already been processed by the
apply-templates above.

 xsl:template match=//em/text() | //strong/text()
You should never start a template match with a //.

 fo:inline
 xsl:if test=ancestor::em
Matching multiple elements and then dispatching again inside a template is
considered bad style.

You should have written two templates:
xsl:template match=em
   fo:wrapper color=rgb(0,255,0)
  xsl:apply-templates/
   /fo:inline
/xsl:template

xsl:template match=strong
   fo:wrapper font-weight=bold
  xsl:apply-templates/
   /fo:inline
/xsl:template

Note further that you should use fo:wrapper instead of fo:inline, unless you
really want to generate inline areas.

J.Pietschmann

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


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



Re: Fonts

2006-03-07 Thread Andreas L Delmelle

On Mar 7, 2006, at 19:26, Andreia Oliveira wrote:

Hi,


This new approach was attempted (separate templates as suggested).
The result is the text inside field1 is not touched at all (as  
before). It

remains as before without any tranformation.
It seems to me that fop is not even applying the template despite  
the fact

that the xml file as references to em and strong elements.


Just to get this straight: FOP never applies templates. That's the  
XSLT processor's job (Xalan, Saxon...).



Maybe I did not explain myself clearly about my purpose:
Inside one XML field  (fo:block) some em and strong tags may  
appear.
If so, fop, when generating the should generate the text inside the  
em and

strong tags in italic and bold.


Starting from something like:

field
  Unformatted text with some emitalic/em and
  strongbold/strong, maybe some
  strongembold-italic/em/strong, or even
  emstrongitalic-bold/strong/em?
/field

Use this template for the 'field' nodes:

xsl:template match=field
  fo:block
xsl:apply-templates /
  /fo:block
/xsl:template

and the following two for the 'em' and 'strong' nodes:

xsl:template match=em
  fo:wrapper font-style=italic
xsl:apply-templates /
  /fo:wrapper
/xsl:template

xsl:template match=strong
  fo:wrapper font-weight=bold
xsl:apply-templates /
  /fo:wrapper
/xsl:template

would lead to the output (indented for readability)

fo:block
  Unformatted text with some
  fo:wrapper font-style=italicitalic/
   and
  fo:wrapper font-weight=boldbold/
  , maybe some
  fo:wrapper font-weight=bold
fo:wrapper font-style=italicbold-italic/
  /
  , or even
  fo:wrapper font-style=italic
fo:wrapper font-weight=bolditalic-bold/
  /
  ?
/

which FOP renders without any problems.

Should do the job nicely, unless there is another error hidden  
somewhere...


Cheers,

Andreas


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



alternatives to floats in fop

2006-03-07 Thread Johannes Künsebeck
Hi,
I try to build a complex design with fop, the design-template can be
seen here :

http://yucca-net.de/data/gild.pdf

After toying around with fop, I'm not sure if it is possible to realize
this design with fop.
I got alternating page-masters and the background-design working.
I can format a fo:block with the design for the even page, I can format
a fo:block with the design for the odd page, but I can't specify when to
use which (the problem you can't see in the template is that it must be
possible to put two or more workshops on one page).

My thoughts so far (not very far):
- use float=inside|outside (XSL1.1) but that's not supported in fop
- put date and time infos in region-start/end, but how can I synchronize
startpositions with the flow?

So my questions are
- Do you think it is possible to realize this with XSLT-FO ( maybe
extensions)
- Do you think it is possible to realize this with fop?
- If yes, what do I have to read, to get it working
thanks in advance,  Hann*
*

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



FOP Example Servlet error

2006-03-07 Thread Sir Strongbad
After a little trouble (and MUCH help from this board!) I was able to
run the FOP servlet build.  I am trying to test it by passing it a
simple XML and XSL document, but it is generating an error as seen
below, in Tomcat.  Is the servlet no seeing the stylesheet?  I have
tried passing the whole path to the XSL, but to no avail.   Any
suggestions?  Thanks in advance...

javax.servlet.ServletException: Could not compile stylesheet
FopServlet.doGet(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)

org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.fop.apps.FOPException: Could not compile stylesheet

org.apache.fop.apps.TraxInputHandler.initTransformer(TraxInputHandler.java:108)
org.apache.fop.apps.TraxInputHandler.init(TraxInputHandler.java:84)
org.apache.fop.apps.XSLTInputHandler.init(XSLTInputHandler.java:71)
FopServlet.doGet(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)

org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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



Re: FOP Example Servlet error

2006-03-07 Thread J.Pietschmann

Sir Strongbad wrote:

I am trying to test it by passing it a
simple XML and XSL document, but it is generating an error as seen
below, in Tomcat.  Is the servlet no seeing the stylesheet?


That's the most probable cause. Another possibility is a faulty
style sheet.
Test your source XML+XSLT using the FOP command line application,
in order to see whether this works.
The path to the style sheet must be either relative to tomcat's CWD,
or a full absolute path (it is not run through the URIResolver).

J.Pietschmann

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



Re: NPE

2006-03-07 Thread Glen Mazza

Andreas L Delmelle wrote:


In the latter case, however:

fo:instream-foreign-object
  svg:svg ...
  ...
  /svg:svg
/fo:instream-foreign-object

Note that the i-f-o now contains two text nodes (= #PCDATA):  
'#x0A;#x20;#x20;' and '#xA0;'




I think they call that insignificant white space, and that would not 
be counted as PCDATA.  Partly explained here, but not definitive either way:


http://www.w3.org/TR/REC-xml/#sec-white-space

Also, this old email[1], which included the above link, has an 
interesting quote of how to interpret whitepace:


Whitespace verifies as #PCDATA if #PCDATA is allowed at a particular 
point.  If #PCDATA is NOT allowed at a particular point, the whitespace 
is ignored for the purposes of verifying.


[1] http://lists.xml.org/archives/xml-dev/199806/msg00386.html

But I'm far from an expert on this stuff.

This means we have a choice to either test every one of those  
characters, or let the 'error' slip through, possibly with a warning.  
Depending on the context, I can imagine users not being very happy if  
FOP were to be unconditionally strict here... [suppose i-f-o is on  one 
of the last pages of a 250 page document :-/]




I don't think that whitespace-only nodes are being created by FOP 
anyway, if the whitespace just exists between two consecutive opening 
tags.  So this problem may not be occuring for the user as it is.


soapboxBut it is a common misperception[2] that strict validation is 
mean and cold-hearted, when in fact is it saves people from submitting 
erroneously built documents/invoices.  Just a warning means that the 
user is required to scroll through the log output of every document 
generation, just to make sure that the document FOP produced is valid, 
and if they fail to do that, then they may submit an incorrect document 
or invoice.  For every hacker irritated by strict validation, two or 
three are probably saved by it--especially billing invoices, where you 
almost certainly would want to halt if you had an XSLT error which would 
otherwise cause an invalid invoice to be created./soapbox


Thankfully FOP has both a strict and non-strict version to suit either 
preference.  Human nature being what it is though, most who clamor for 
the latter, as soon as it is provided to them, start using the former 
anyway.


Glen

[2] http://marc.theaimsgroup.com/?l=fop-devm=111365780207108w=2


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