Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-12 Thread Peter . Neu
Hello, I reworked the xml creation in the servlet but still the result is blank. Please have a look at the attached servlet and the stylesheet. For the sake of visibility I refrain from posting it inside this mail :o) cheers, Pete --- Ursprüngliche Nachricht --- Von: J.Pietschmann [EMAIL

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-12 Thread Jeremias Maerki
I just sent Peter back a corrected version of his code. Basically, I've changed this: - For SAX generation, the namespace URI must be null sein, not null or . - localName must be the same value as qName when no namespaces are used like here wrong: handler.startElement(, , root, atts); or:

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-12 Thread Andreas L Delmelle
On Dec 11, 2005, at 22:49, J.Pietschmann wrote: [EMAIL PROTECTED] wrote: handler.startElement(, , root, atts); ^^ This doesn't look good. Try null here. Did you try to serialize the generated XML? Arrgh!! Leave it up to me to make the same mistake as the OP. Nice

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Peter . Neu
Hi, I just added a root node. But it has no effect on the transformation both the fo and pdf do not conatain any xml input. It seems the xsl tranformation just ignores the hello tag. cheers, Pete --- Ursprüngliche Nachricht --- Von: Andreas L Delmelle [EMAIL PROTECTED] An:

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Andreas L Delmelle
On Dec 9, 2005, at 18:41, [EMAIL PROTECTED] wrote: Pete, I just added a root node. But it has no effect on the transformation both the fo and pdf do not conatain any xml input. It seems the xsl tranformation just ignores the hello tag. Is that the stylesheet with or without the

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Peter . Neu
Hi, for this test I used the stylesheet with the xsl:for-each tag. I was hoping the transformation would pick up the xml tag with the input. I'm also 100% clueless... cheers, Pete --- Ursprüngliche Nachricht --- Von: Andreas L Delmelle [EMAIL PROTECTED] An:

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Andreas L Delmelle
On Dec 9, 2005, at 19:36, [EMAIL PROTECTED] wrote: Hi, for this test I used the stylesheet with the xsl:for-each tag. I was hoping the transformation would pick up the xml tag with the input. BTW: What do you mean by the FO not containing any xml input? Is there nothing in the FO at

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Peter . Neu
No offense taken ;o) Yes, I did correct the mistake. Fo without input looks like this: ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xdt=http://www.w3.org/2004/07/xpath-datatypes; xmlns:fn=http://www.w3.org/2004/07/xpath-functions;

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Andreas L Delmelle
On Dec 9, 2005, at 19:56, [EMAIL PROTECTED] wrote: No offense taken ;o) Yes, I did correct the mistake. Arrgh, *my* mistake... xsl:for-each select=*/Hello or xsl:for-each select=root/Hello should do the trick. Tested and confirmed. Cheers, Andreas

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Andreas L Delmelle
On Dec 9, 2005, at 20:04, Andreas L Delmelle wrote: On Dec 9, 2005, at 19:56, [EMAIL PROTECTED] wrote: No offense taken ;o) Yes, I did correct the mistake. Arrgh, *my* mistake... xsl:for-each select=*/Hello or xsl:for-each select=root/Hello or xsl:template match=root instead of match=/

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Peter . Neu
Are you using some kind of special parser? Or is this maybe a bug in my fop version? My configuration: Servlet: handler.startElement(, , root, atts); handler.startElement(, , Hello, atts); handler.characters(Hello.toCharArray(), 0, Hello.length()); handler.endElement(, , Hello);

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-09 Thread Andreas L Delmelle
On Dec 9, 2005, at 20:28, [EMAIL PROTECTED] wrote: Are you using some kind of special parser? Or is this maybe a bug in my fop version? My configuration: Errmm, you're right again. Sorry, no that's not it... By testing, I meant running the XSLT with an XML corresponding to the SAX events

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread Peter . Neu
Hello, I have a hard time getting the Obj2Pdf Example to work with my application. I was browsing through the FAQ and found another example http://xmlgraphics.apache.org/fop/0.20.5/servlets.html#xslt But also here is the problem I don't know how to pass the generated xml file to a File object.

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread Peter . Neu
Hi, sorry maybe I created a little misunderstanding here. I attached some source code as a .txt file to clear up things. cheers, Pete --- Ursprüngliche Nachricht --- Von: Jeremias Maerki [EMAIL PROTECTED] An: fop-users@xmlgraphics.apache.org Betreff: Re: How to pass input of xml tranfs.

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread Jeremias Maerki
It's unclear what this XmlTransformer does exactly. You only instantiate a new instance but you do nothing with it. Anyway, I'll try to rework your code so you can pipe this stuff together: 1. You don't need the FileOutputStream anymore. 2. No need to configure the serializer if you just pipe

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread Peter . Neu
First of all. Thanks for taking so much time for my problem :o) I tried to include your code. It's attached below: 1. the transformer factory with the implementation I use does not support this call: this.transformerFactory.newTransformerHandler(xsltSrc); - so I modified it a bit. 2. When I run

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread Jeremias Maerki
I'm not sure why you get an error that handler is null. The setup looks ok now. The only thing that's missing is the ByteArrayOutputStream that FOP writes the PDF output to. In order to make PDF displaying work you need to know the size of the PDF so there's no way around buffering the PDF into a

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread Peter . Neu
OK, the ByteArrayOutputStream solves the NullPointer Exception. The only problem left is there is none of my xml data in the pdf. I only get the static header of the xsl document :o/ Do we have to change the sequence somehow? --- Ursprüngliche Nachricht --- Von: Jeremias Maerki [EMAIL

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-08 Thread J.Pietschmann
[EMAIL PROTECTED] wrote: OK, the ByteArrayOutputStream solves the NullPointer Exception. The only problem left is there is none of my xml data in the pdf. I only get the static header of the xsl document :o/ The most likely reason is that you don't generate FO objects for the real content. If

How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread Peter . Neu
Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation to the XSLTInputHandler. My code uses a static xsl document and dynamic xml documents. For demonstration purposes I create the xml file on the local

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread Glen Mazza
Don't use XSLTInputHandler. Use JAXP[1] instead. Glen [1] http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#examples [EMAIL PROTECTED] wrote: Hello, I struggling to create a webapps that creates pdf's for xml documents. The problem is: I can't pipe the output of my SAX transformation

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread Peter . Neu
Hi Glenn did you mean this example? Taken from [1]. Does this work in a webapp? //Setup output OutputStream out = new java.io.FileOutputStream(pdf); try { driver.setOutputStream(out); //Setup XSLT TransformerFactory factory = TransformerFactory.newInstance();

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread Jeremias Maerki
Yes, that's basically it, though ExampleObj2PDF is a bit special. ExampleXML2PDF is the more generic example. And yes, it works in a webapp. On 07.12.2005 21:39:58 Peter.Neu wrote: Hi Glenn did you mean this example? Taken from [1]. Does this work in a webapp? //Setup output

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread J.Pietschmann
[EMAIL PROTECTED] wrote: did you mean this example? Yes. Does this work in a webapp? Yes. You have to use a ByteArrayOutputStream as a buffer to set the content length HTTP header correctly (there are many code samples on the net for this detail). Why do do think it might not work?

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread Jeremias Maerki
Pete, I see. No, in this case you're not missing anything although you may not need to rewrite your whole code just to accomodate the new pattern. Generating XML using SAX events is one way to generate XML, a good way but not necessarily the only one. Remember that JAXP is quite flexible and that

Re: How to pass input of xml tranfs. to xslt transf. ?

2005-12-07 Thread Peter . Neu
Hello Jeremias, good your are in the cet time zone,too ;o). My code also uses sax so the refactoring process will not be that long. Anyway it's always good to have a working example so I'll adapt to that. I'll be back with details when I'm done refactoring. cheers, Pete --- Ursprüngliche