nullPointerException

2001-07-17 Thread Wolf Gustavo (SGC-EXT)

Hi all,
  I am trying to get an XMLReader object with 

 XMLReader parser = inputHandler.getParser(); 

after having done: InputHandler inputHandler = new
XSLTInputHandler(xmlInputSource,xslInputSource);

and I get the following error (the files xmlInputSource and xslInputSource
are where they are suppossed to be):

java.lang.NullPointerException
Caught exception: java.lang.NullPointerException
java.lang.NullPointerException
at
org.apache.fop.apps.InputHandler.createParser(InputHandler.java:58)
at
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:117)
at TestXSLT.(TestXSLT.java:29)

It seems to me that I am missing some library, but I am using fop, xerces
and xalan in that order, as I was told others where doing, with a program
that worked for others. 

Does anyone have an idea of what could be wrong?

Thanks really a lot,
   Gustavo

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




RE: fonts

2001-07-16 Thread Wolf Gustavo (SGC-EXT)

Thanks for the tip Rajeev,
Gustavo

-Message d'origine-
De : rajeev nair [mailto:[EMAIL PROTECTED]]
Envoye : lundi, 16. juillet 2001 07:18
A : [EMAIL PROTECTED]
Objet : Re: fonts


hello
why don't u make ur own font metric xml file for
arial?
You can make it from ttf files easily by using the
class TTFReader in fop.
regards
rajiv

--- "Wolf Gustavo (SGC-EXT)" <[EMAIL PROTECTED]>
wrote:
> Hi all,
> has someone implemmented Arial and
> Arial-italics?
> If the answer is yes, could I get the corresponding
> files?
> 
> Also, does Helvetica (what I am replacing Arial
> with) have italics?
> 
> Thanks once more,
>  Gustavo
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, email:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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

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




fonts

2001-07-13 Thread Wolf Gustavo (SGC-EXT)

Hi all,
has someone implemmented Arial and Arial-italics?
If the answer is yes, could I get the corresponding files?

Also, does Helvetica (what I am replacing Arial with) have italics?

Thanks once more,
 Gustavo

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




space

2001-07-13 Thread Wolf Gustavo (SGC-EXT)

Hi all,
  the documents I am preparing are divided in sections. How can I
ask Fop to check how much space is left on the page, in order to decide
whether to write the title of the section in a new page or not? (If there is
a lot of space left, I don't want to cut to next page).

Thanks a lot,
 Gustavo

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




RE: question on fonts

2001-07-12 Thread Wolf Gustavo (SGC-EXT)

Alex, your idea works perfect.

Thanks a lot,
Gustavo



-Message d'origine-
De : Alex McLintock [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi, 12. juillet 2001 11:25
À : [EMAIL PROTECTED]
Objet : Re: question on fonts


 --- "Wolf Gustavo (SGC-EXT)" <[EMAIL PROTECTED]> wrote: 
> Hi all,
>   does anyone know how to make fop transform a th (like in 4th) in
> order to put it as superscript with a small font (in good ol'LateX it
would
> go like $4^{th}$)?

You might try 

4th

though I haven't tried it..




=
Alex McLintock[EMAIL PROTECTED]Open Source Consultancy in London
OpenWeb Analysts Ltd, http://www.OWAL.co.uk/ 
DR WHO COMPETITION:
http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104
Get Your XML T-Shirt  at http://www.inversity.co.uk/


Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

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

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




fo:flow within fo:page-sequence

2001-07-12 Thread Wolf Gustavo (SGC-EXT)

Hi,
  in the XML bible, chap. 15, I read that for a  fo:page-sequence I can
have one fo:flow per region, i.e.: ,
and then another like , etc,  which
makes 5 in total per page.
However, when I try to define one flow for body and another for after, Fop
tells me that "only a single fo:flow admitted per fo:page-sequence".
Does anybody know how to solve this?
Thanks a lot, Gustavo


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




question on fonts

2001-07-12 Thread Wolf Gustavo (SGC-EXT)

Hi all,
  does anyone know how to make fop transform a th (like in 4th) in
order to put it as superscript with a small font (in good ol'LateX it would
go like $4^{th}$)?

Thanks a lot,
Gustavo



 

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




RE: XSLTInputHandler not doing its job??: beers

2001-07-10 Thread Wolf Gustavo (SGC-EXT)
Title: RE: XSLTInputHandler not doing its job??



ah!! 
finally I got it!! it was not a problem of my XML, but just the way to 
display in frigging IE!!
 
BTW, I 
have not yet solved my problem with the parser but had to move along to other 
parallel problems with the XSLT.
 
Anyway, more than a few are entitled to free beers when they pass by 
Geneva (CH) (oder rotwein), mainly Karen, Jens and Erik.
 
Thanks 
to all, 
 
    
Gustavo

  -Message d'origine-De : James Telfer 
  [mailto:[EMAIL PROTECTED]]Envoyé : mardi, 10. juillet 2001 
  11:02À : '[EMAIL PROTECTED]'Objet : RE: 
  XSLTInputHandler not doing its job??
  erm - did you look at the source? When you view an XML doc in iexplore, 
  it doesn't display the DTD. I had a quick peek at the DTD in the source and it 
  looks ok. Try right-clicking and choosing "view source".
  
-Original Message-From: Williamson, James 
[mailto:[EMAIL PROTECTED]]Sent: Monday, July 09, 
2001 10:28 PMTo: '[EMAIL PROTECTED]'Subject: RE: 
XSLTInputHandler not doing its job??
Gustavo, 
 
The point I was trying to make 
is that this isn't valid (in the xml file you 
posted): 
 
  (View Source for full 
doctype...)> 
 
And the fact that 
you're getting error messages with this in it might be the 
problem?!
 
And why are youd 
eclaring the fo namespace twice in your xsl file?
 
Regards, 

 
James
    
      -Original Message-From: Wolf Gustavo (SGC-EXT) 
  [mailto:[EMAIL PROTECTED]]Sent: 06 July 2001 
  10:04To: '[EMAIL PROTECTED]'Subject: RE: 
  XSLTInputHandler not doing its job??
  James,
     
  I am sorry but I don't understand your answer. Do you mean that writing 
  the word periodic in the !DOCTYPE is wrong? As far as I see in examples it 
  is not (cf: www.xml101.com/dtd/dtd_intro.asp 
  ).
   
  Anyway, as a line command Fop gives the same answer with or without 
  the DTD within the XML file, so I still have that 
  problem.
   
  If I did not get the point at all, would you please mind explaining 
  me again?
   
  Thanks a lot,
   
  Gustavo
  
-Message d'origine-De : Williamson, James 
[mailto:[EMAIL PROTECTED]]Envoyé : jeudi, 
5. juillet 2001 18:15À : 
'[EMAIL PROTECTED]'Objet : RE: XSLTInputHandler not 
doing its job??
Wolf, 
That's not valid XML, when it says view source for full 
doctype it doesn't expect you to take that literally. DOCTYPE's generally take these form: 
 

or 
 
or (embedded) 
 
    your 
embedded DTD ]> 
I'm no FOP expert but I'm sure I remember being able to 
configure FOP to tolerate XML (i.e. HTML) perhaps you could have a look 
at the source code for the FOP app.
Regards, 
James 
-Original Message- From: 
Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]] 
Sent: 05 July 2001 16:50 To: 
Fop (E-mail) Subject: XSLTInputHandler not doing 
its job?? 
Hi,   as I said a few hours ago, I have 
the following code: 
    InputHandler 
inputHandler = new XSLTInputHandler(xmlInputSource,xslInputSource);     InputSource 
inputSource = inputHandler.getInputSource();     XMLReader  parser 
= (XMLReader) Class.forName(this.parserClass).newInstance();   parser.setFeature("http://xml.org/sax/features/namespace-prefixes",true); 
/** * Creates the driver 
telling it to write the output to a file. */     Driver driver = new 
Driver();     
driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer"); 
//  ERROR IN THE FOLLOWING LINE     
driver.buildFOTree(parser, inputSource);     File test = new 
File("test.pdf");     
driver.setOutputStream(new java.io.FileOutputStream(test)); 
    
driver.format();     
driver.render(); 
In the second line, InputSource inputSource is suppossed 
to be the .fo file after the processing of 
xmlInputSource by xslInputSource. 
I am using as xmlInputSource and xslInputSource two 
files that I took from the chap 15 of the 
XMLbible (attached). 
Now, when the program tries to execute 
"driver.buildFOTree(parser, inputSource);", I 
get the following msg and Exception: 
"building formatting object tree  WARNING: Unknown formatting object ^PERIODIC_TABLE 
 FOPException: org.xml.sax.SAXException (msg: 
null)" 
It seems 

minimal set of libraries for Fop + Tomcat?

2001-07-09 Thread Wolf Gustavo (SGC-EXT)

Hi,
  After interchanging a couple of mails with Karen and Eriok, I've come
to think that a problem I am experiencing might be related to too many jar
files in my classpath (or wrong order of the files).

Does someone have a minimal (ordered) set that would let fop run from a
servlet that is contained within Tomcat?

Thanks a lot,

 Gustavo
 



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




RE: Need Working Sample

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

Hi Erik,
 I have tried your stuff, but it still gives me the same problem i
have since two days after I try to instantiate the parser:

javax.xml.transform.TransformerConfigurationException: Namespace not
supported by SAXParser
Error msg: null

At the risk of looking abusive, could someone take a look at the xml and xsl
files (they are really short examples that work with Fop as a line command,
and I'll invite a beer to whomever comes to Geneva (CH, not IL) to pick it
up)?

They are attached once more.

Really thanks, and sorry to know that Jim cannot use my non-elegant
solution. I am fighting this stuff for days also and I have to finish my
project by next Friday.



-Message d'origine-
De : Erik Rehrmann [mailto:[EMAIL PROTECTED]]
Envoyé : vendredi, 6. juillet 2001 17:26
À : '[EMAIL PROTECTED]'
Objet : AW: Need Working Sample


Hi Gustavo,

the following works great:

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
  org.xml.sax.XMLReader parser = inputHandler.getParser();
  driver.buildFOTree(parser, inputHandler.getInputSource());
  driver.format();
  driver.setOutputStream(out);
  driver.render();

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

This example lets the servlet stream the result directly to the client
browser. If you want to have the pdf file on your disk instead, just write
use an other output stream!

It currently does not work for IE5.5, but I'll check the hint of Alex
McLintock earlier in this list.

Hope this helps you out,
___
Erik Rehrmann - IOn AG
[EMAIL PROTECTED]




> -----Ursprüngliche Nachricht-
> Von: Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 6. Juli 2001 17:11
> An: '[EMAIL PROTECTED]'
> Betreff: RE: Need Working Sample
> 
> 
> Hi Jim,
> I have exactly the same problem, and I've just found a non
> elegant, working solution:
> 
> I generate my XML file, and then call the command line Fop 
> from within my
> servlet:
> 
> Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
> "c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib
> \\w3c.jar;c:\\
> fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-
> DEV\\lib\\xerc
> es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
> "org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
> "c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"}); 
> 
> As I said, it is NOT elegant, but after sweating for days 
> with problems of
> all type doing the elegant thing, I get my beautiful PDF on disk.
> 
> Of course you should adapt the names of trhe directories  and 
> the xml and
> xsl files.
> 
> Cheers,
>Gustavo
> 
> PS: if someone has an elegant solution I would be happy to 
> use it too. 
> 
> >  -Message d'origine-
> > De :Jim Urban [mailto:[EMAIL PROTECTED]] 
> > Envoyé :vendredi, 6. juillet 2001 17:09
> > À : [EMAIL PROTECTED]
> > Objet : Need Working Sample
> > 
> > Hi, I am new to FOP.  I have a servlet which dynamically 
> generates XML.  I
> > need to apply an XSL stylesheet containing FO tags to generate a FO
> > version of the XML and then I need to run this FO version of the XML
> > through FOP (or Driver) so the servlet can return a 
> dynamically created
> > PDF to the browser.  Does anyone have a working example of 
> how to do this?
> > Only the XSL style sheet containing the FO tags used in the initial
> > transform will be on disk.  Please help, I have to get this working.
> > 
> > Thanks,
> > 
> > Jim Urban
> > Product Manager
> > Netsteps Inc.
> > Suite 505E
> > 1 Pierce Pl.
> > Itasca, IL  60143
> > Voice:  (630) 250-3045 x2164
> > Fax:  (630) 250-3046
> > 
> > << Fichier: ATT14204.txt>> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 

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



 prueba.xml
 prueba.xsl

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


RE: Need Working Sample

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

The problem with that example is that it assumes that you already have the
.fo file, the production of which I've found to be the difficult part.

Gustavo

-Message d'origine-
De : Cyril Rognon [mailto:[EMAIL PROTECTED]]
Envoye : vendredi, 6. juillet 2001 17:03
A : [EMAIL PROTECTED]
Objet : Re: Need Working Sample


There is a FOP servlet example in the distribution of FOP :

/docs/examples/embedding/FopServlet.java

I think it will answer all the beginners questions.
See the example section on the FOP site to see all pre-answered question 
you might have in your beginning journey.
(starting with http://xml.apache.org/fop/embedding.html)

Cyril

At 10:08 06/07/01 -0500, you wrote:
>Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
>need to apply an XSL stylesheet containing FO tags to generate a FO version
>of the XML and then I need to run this FO version of the XML through FOP
(or
>Driver) so the servlet can return a dynamically created PDF to the browser.
>Does anyone have a working example of how to do this?  Only the XSL style
>sheet containing the FO tags used in the initial transform will be on disk.
>Please help, I have to get this working.
>
>Thanks,


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

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




RE: Need Working Sample

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

Hi Jim,
I have exactly the same problem, and I've just found a non
elegant, working solution:

I generate my XML file, and then call the command line Fop from within my
servlet:

Runtime.getRuntime().exec(new String[]{"java.exe", "-cp",
"c:\\fop\\Fop-0.18.1-DEV\\fop.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\w3c.jar;c:\\
fop\\Fop-0.18.1-DEV\\lib\\xalan-2.0.0.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\xerc
es-1.2.3.jar;c:\\fop\\Fop-0.18.1-DEV\\lib\\jimi-1.0.jar",
"org.apache.fop.apps.Fop", "-xml" , "c:\\prueba.xml", "-xsl" ,
"c:\\prueba.xsl", "-pdf" , "c:\\prueba.pdf"}); 

As I said, it is NOT elegant, but after sweating for days with problems of
all type doing the elegant thing, I get my beautiful PDF on disk.

Of course you should adapt the names of trhe directories  and the xml and
xsl files.

Cheers,
   Gustavo

PS: if someone has an elegant solution I would be happy to use it too. 

>  -Message d'origine-
> De :  Jim Urban [mailto:[EMAIL PROTECTED]] 
> Envoyé :  vendredi, 6. juillet 2001 17:09
> À :   [EMAIL PROTECTED]
> Objet :   Need Working Sample
> 
> Hi, I am new to FOP.  I have a servlet which dynamically generates XML.  I
> need to apply an XSL stylesheet containing FO tags to generate a FO
> version of the XML and then I need to run this FO version of the XML
> through FOP (or Driver) so the servlet can return a dynamically created
> PDF to the browser.  Does anyone have a working example of how to do this?
> Only the XSL style sheet containing the FO tags used in the initial
> transform will be on disk.  Please help, I have to get this working.
> 
> Thanks,
> 
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL  60143
> Voice:  (630) 250-3045 x2164
> Fax:  (630) 250-3046
> 
> << Fichier: ATT14204.txt>> 

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




RE: XSLTInputHandler not doing its job??

2001-07-06 Thread Wolf Gustavo (SGC-EXT)
Title: RE: XSLTInputHandler not doing its job??



James,
   
I am sorry but I don't understand your answer. Do you mean that writing the word 
periodic in the !DOCTYPE is wrong? As far as I see in examples it is not (cf: www.xml101.com/dtd/dtd_intro.asp 
).
 
Anyway, as a line command Fop gives the same answer with or without the 
DTD within the XML file, so I still have that problem.
 
If I 
did not get the point at all, would you please mind explaining me 
again?
 
Thanks 
a lot,
 
Gustavo

  -Message d'origine-De : Williamson, James 
  [mailto:[EMAIL PROTECTED]]Envoyé : jeudi, 5. 
  juillet 2001 18:15À : 
  '[EMAIL PROTECTED]'Objet : RE: XSLTInputHandler not doing 
  its job??
  Wolf, 
  That's not valid XML, when it says view source for full 
  doctype it doesn't expect you to take that literally. DOCTYPE's generally take these form: 
   
  or 
   
  or (embedded) 
   
      your embedded 
  DTD ]> 
  I'm no FOP expert but I'm sure I remember being able to 
  configure FOP to tolerate XML (i.e. HTML) perhaps you could have a look at the 
  source code for the FOP app.
  Regards, 
  James 
  -----Original Message- From: Wolf 
  Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]] 
  Sent: 05 July 2001 16:50 To: Fop 
  (E-mail) Subject: XSLTInputHandler not doing its 
  job?? 
  Hi,   as 
  I said a few hours ago, I have the following code: 
      InputHandler 
  inputHandler = new XSLTInputHandler(xmlInputSource,xslInputSource);     InputSource inputSource = 
  inputHandler.getInputSource();     XMLReader  parser = 
  (XMLReader) Class.forName(this.parserClass).newInstance();   parser.setFeature("http://xml.org/sax/features/namespace-prefixes",true); 
  /** * Creates the driver telling it 
  to write the output to a file. */     Driver driver = new 
  Driver();     
  driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer"); //  ERROR IN THE FOLLOWING LINE     driver.buildFOTree(parser, 
  inputSource);     File test = new 
  File("test.pdf");     driver.setOutputStream(new 
  java.io.FileOutputStream(test));     driver.format(); 
      
  driver.render(); 
  In the second line, InputSource inputSource is suppossed to be 
  the .fo file after the processing of xmlInputSource by 
  xslInputSource. 
  I am using as xmlInputSource and xslInputSource two files that 
  I took from the chap 15 of the XMLbible 
  (attached). 
  Now, when the program tries to execute 
  "driver.buildFOTree(parser, inputSource);", I get the 
  following msg and Exception: 
  "building formatting object tree  WARNING: Unknown formatting object ^PERIODIC_TABLE 
   FOPException: org.xml.sax.SAXException (msg: 
  null)" 
  It seems to me that XSLTInputHandler is not doing its job 
  properly, because of the WARNING. 
  Again, if I run a line command with Fop -xml xmlInputSource -xsl xslInputSource -pdf test.pdf 
  everything is OK, which tells me that there shouldn't 
  be a problem with the input files. 
  Does anyone knows how to cure this? 
  Thanks a lot,     
  Gustavo 
   <>  
  <> **This 
  e-mail (including any documents which may accompany it) 
  containsinformation which is confidential and may also be 
  privileged.It is for the exclusive use of the intended recipient(s).If 
  you are not the intended recipient(s) please note that any form 
  ofdistribution, copying or use of this e-mail or the information in 
  itor attached to it is strictly prohibited and may be unlawful.If you 
  have received this e-mail in error please notify us immediatelyby e-mail 
  to [EMAIL PROTECTED] or telephone +44 (0)207 940 1200 anddelete the 
  e-mail.Please advise immediately if you or your employer do not consent 
  toInternet E-Mail for messages of this type.Information or opinions in 
  this message that do not relate to thebusiness of Windsor plc and/or 
  subsidiary and/or associated companiesshall be treated as neither given or 
  endorsed by 
  it.**


Re:RE: XSLTInputHandler not doing its job??

2001-07-06 Thread Wolf Gustavo (SGC-EXT)

Hello Karen and the others,
   the truth is that I had initially tried to
use 
XMLReader parser = inputHandler.getParser();
at the beginning, and it gave me the following error:

javax.xml.transform.TransformerConfigurationException: Namespace not
supported by SAXParser.

Then Keiron Liddle suggested me to introduce the parser in a different
manner, which was what I used. It may have made the second problem appear
when I call the builFOTree:

WARNING: Unknown formatting object ^PERIODIC_TABLE
FOPException: org.xml.sax.SAXException (msg: null)"

since as you explained 

InputSource inputSource = inputHandler.getInputSource();

seems to be bringing back the original XML, and not as I thought the .fo
file.

So, back to square zero:

How can I solve the problem of  XMLReader parser = inputHandler.getParser();
??

I attach the xml and xsl files just in case.

Thanks a lot once more,
   Gustavo




-Message d'origine-
De : Karen Lease [mailto:[EMAIL PROTECTED]]
Envoye : jeudi, 5. juillet 2001 22:56
A : [EMAIL PROTECTED]
Objet : Re: XSLTInputHandler not doing its job??


Hi Gustavo,

I'm not 100% sure, but it looks to me as if you get the parser from the
inputHandler instead of using newInstance, it will work. That's what FOP
does when you pass it the xml and xsl in the command line.

InputHandler inputHandler = new
XSLTInputHandler(xmlInputSource,xslInputSource);
XMLReader parser = inputHandler.getParser();
InputSource inputSource = inputHandler.getInputSource();

Then pass that to the driver.

What is happening is that the inputSource you're getting back now is
just returning your original XML file. When you call getParser() on the
XSLTInputHandler, it's actually going to "parse" the FO file which
results from transforming your xml with the xsl.

Hope that helps,
Karen Lease


"Wolf Gustavo (SGC-EXT)" wrote:
> 
> Hi,
>   as I said a few hours ago, I have the following code:
> 
> InputHandler inputHandler = new
> XSLTInputHandler(xmlInputSource,xslInputSource);
> InputSource inputSource = inputHandler.getInputSource();
> XMLReader  parser = (XMLReader)
> Class.forName(this.parserClass).newInstance();
> 
> parser.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
> /**
> * Creates the driver telling it to write the output to a file.
> */
> Driver driver = new Driver();
> driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer");
> //  ERROR IN THE FOLLOWING LINE
> driver.buildFOTree(parser, inputSource);
> File test = new File("test.pdf");
> driver.setOutputStream(new java.io.FileOutputStream(test));
> driver.format();
> driver.render();
> 
> In the second line, InputSource inputSource is suppossed to be the .fo
file
> after the processing of xmlInputSource by xslInputSource.
> 
> I am using as xmlInputSource and xslInputSource two files that I took from
> the chap 15 of the XMLbible (attached).
> 
> Now, when the program tries to execute "driver.buildFOTree(parser,
> inputSource);", I get the following msg and Exception:
> 
> "building formatting object tree
>  WARNING: Unknown formatting object ^PERIODIC_TABLE
>  FOPException: org.xml.sax.SAXException (msg: null)"
> 
> It seems to me that XSLTInputHandler is not doing its job properly,
because
> of the WARNING.
> 
> Again, if I run a line command with
> Fop -xml xmlInputSource -xsl xslInputSource -pdf test.pdf
> everything is OK, which tells me that there shouldn't be a problem with
the
> input files.
> 
> Does anyone knows how to cure this?
> 
> Thanks a lot,
> Gustavo
> 
>  <>  <>
> 
>   
>  Name: prueba.xml
>prueba.xmlType: unspecified type (application/octet-stream)
>  Encoding: quoted-printable
> 
>prueba.xslName: prueba.xsl
>  Type: unspecified type (application/octet-stream)
> 
>   
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


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



 prueba.xml
 prueba.xsl

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


XSLTInputHandler not doing its job??

2001-07-05 Thread Wolf Gustavo (SGC-EXT)

Hi,
  as I said a few hours ago, I have the following code:

InputHandler inputHandler = new
XSLTInputHandler(xmlInputSource,xslInputSource);
InputSource inputSource = inputHandler.getInputSource();
XMLReader  parser = (XMLReader)
Class.forName(this.parserClass).newInstance();
 
parser.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
/**
* Creates the driver telling it to write the output to a file.
*/
Driver driver = new Driver();
driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer");
//  ERROR IN THE FOLLOWING LINE
driver.buildFOTree(parser, inputSource);
File test = new File("test.pdf");
driver.setOutputStream(new java.io.FileOutputStream(test));
driver.format();
driver.render();

In the second line, InputSource inputSource is suppossed to be the .fo file
after the processing of xmlInputSource by xslInputSource.

I am using as xmlInputSource and xslInputSource two files that I took from
the chap 15 of the XMLbible (attached).

Now, when the program tries to execute "driver.buildFOTree(parser,
inputSource);", I get the following msg and Exception:

"building formatting object tree
 WARNING: Unknown formatting object ^PERIODIC_TABLE
 FOPException: org.xml.sax.SAXException (msg: null)"

It seems to me that XSLTInputHandler is not doing its job properly, because
of the WARNING.

Again, if I run a line command with 
Fop -xml xmlInputSource -xsl xslInputSource -pdf test.pdf 
everything is OK, which tells me that there shouldn't be a problem with the
input files.

Does anyone knows how to cure this? 

Thanks a lot,
Gustavo





 <>  <> 



 prueba.xml
 prueba.xsl

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


RE: problem to define a new Driver()

2001-07-05 Thread Wolf Gustavo (SGC-EXT)

Merci Stéphane,
it worked. 

Gustavo

-Message d'origine-
De : Stéphane LEMAIRE [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi, 5. juillet 2001 13:36
À : [EMAIL PROTECTED]
Objet : RE: problem to define a new Driver()


The version of w3c.jar you use is too old, it seems he doesn't contains
SVGStringList class.
Make your classpath point on the w3c.jar of your fop distribution (in the
lib directory).

-Message d'origine-
De : Wolf Gustavo (SGC-EXT) [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 5 juillet 2001 11:10
À : '[EMAIL PROTECTED]'
Objet : problem to define a new Driver()


Hi again,
   when I am trying to define

Driver driver =  new Driver();

I get the following error:

java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGStringList
at
org.apache.fop.svg.SVGElementMapping.addToBuilder(SVGElementMapping.java:90)

at org.apache.fop.apps.Driver.addElementMapping(Driver.java:314)
at org.apache.fop.apps.Driver.addElementMapping(Driver.java:326)
at org.apache.fop.apps.Driver.setupDefaultMappings(Driver.java:209)
at org.apache.fop.apps.Driver.(Driver.java:137)

I have imported the following, so I don't know why is there a problem:

import org.w3c.dom.svg.*;
import org.apache.fop.dom.svg.*;

Am I missing something else?

Thanks really a lot, and sorry for the newbie questions.

Gustavo

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


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

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




problem to define a new Driver()

2001-07-05 Thread Wolf Gustavo (SGC-EXT)

Hi again,
   when I am trying to define 

Driver driver =  new Driver();

I get the following error: 

java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGStringList 
at
org.apache.fop.svg.SVGElementMapping.addToBuilder(SVGElementMapping.java:90)

at org.apache.fop.apps.Driver.addElementMapping(Driver.java:314) 
at org.apache.fop.apps.Driver.addElementMapping(Driver.java:326) 
at org.apache.fop.apps.Driver.setupDefaultMappings(Driver.java:209) 
at org.apache.fop.apps.Driver.(Driver.java:137) 

I have imported the following, so I don't know why is there a problem:

import org.w3c.dom.svg.*;
import org.apache.fop.dom.svg.*;

Am I missing something else?

Thanks really a lot, and sorry for the newbie questions.

Gustavo

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




RE: problem to run fop within a servlet

2001-07-05 Thread Wolf Gustavo (SGC-EXT)

Thanks a lot Keiron, it worked.

Just in case someone has this problem, the final stuff looks like:

private String parserClass= "org.apache.xerces.parsers.SAXParser";
...
XMLReader  parser = (XMLReader)
Class.forName(this.parserClass).newInstance();
 
parser.setFeature("http://xml.org/sax/features/namespace-prefixes",true);

Gustavo

-Message d'origine-
De : Keiron Liddle [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi, 5. juillet 2001 09:59
À : [EMAIL PROTECTED]
Objet : Re: problem to run fop within a servlet


I'm not sure if this is the what you need but you may want to try putting
this in.

parser.setFeature("http://xml.org/sax/features/namespace-prefixes";,
      true);

On Thu, 05 Jul 2001 09:49:57 Wolf Gustavo (SGC-EXT) wrote:
> Hello,
>I am trying to run fop within my servlet.
> In order to do that, I use:
> 
> InputHandler inputHandler = new
> XSLTInputHandler(xmlInputSource,xslInputSource);
> InputSource inputSource = inputHandler.getInputSource();
> //FAILURE HERE
> XMLReader  parser = inputHandler.getParser();
> /**
> * Creates the driver telling it to write the output file to screen (AWT).
> */
> Driver driver = new Driver();
> driver.setRenderer(this.AWTRendererClass);
> driver.buildFOTree(parser, inputSource);
> driver.format();
> driver.render();
> 
> First and second lines run OK. Third line gives an exception:
> javax.xml.transform.TransformerConfigurationException: Namespace not
> supported by SAXParser exception.message: null 
> 
> There is in principle no problem with the xmlInputSource and
> xslInputSource,
> because when I run fop from the command line:
> 
> Fop -xml xmlInputSource.xml -xsl xslInputSource.xsl -pdf output.pdf (or
> option -awt), 
> 
> I get proper results.
> 
> COuld someone please tell me what am I doing wrong, or what am I missing?
> 
> Also, are the lines related to the Driver correct?
> 
> Thanks a lot for your help,
> Gustavo 


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

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




problem to run fop within a servlet

2001-07-05 Thread Wolf Gustavo (SGC-EXT)

Hello,
   I am trying to run fop within my servlet.
In order to do that, I use:

InputHandler inputHandler = new
XSLTInputHandler(xmlInputSource,xslInputSource);
InputSource inputSource = inputHandler.getInputSource();
//FAILURE HERE
XMLReader  parser = inputHandler.getParser();
/**
* Creates the driver telling it to write the output file to screen (AWT).
*/
Driver driver = new Driver();
driver.setRenderer(this.AWTRendererClass);
driver.buildFOTree(parser, inputSource);
driver.format();
  driver.render();

First and second lines run OK. Third line gives an exception:
javax.xml.transform.TransformerConfigurationException: Namespace not
supported by SAXParser exception.message: null 

There is in principle no problem with the xmlInputSource and xslInputSource,
because when I run fop from the command line:

Fop -xml xmlInputSource.xml -xsl xslInputSource.xsl -pdf output.pdf (or
option -awt), 

I get proper results.

COuld someone please tell me what am I doing wrong, or what am I missing? 
Also, are the lines related to the Driver correct?

Thanks a lot for your help,
Gustavo 

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