Re: roblem with XSLT Trasformations - was problem generating PDF using FOP
Re: roblem with XSLT Trasformations - was problem generating PDF using FOP
- Subject: Re: roblem with XSLT Trasformations - was problem generating PDF using FOP
- From: Amedeo Mantica <email@hidden>
- Date: Tue, 10 Oct 2006 16:59:38 +0200
Thaks for collaboration Steve
I tried, but got same identical result
regards
Amedeo
On 10/ott/06, at 16:36, Steve Quirk wrote:
I think your problem may be caused bby converting your XML and XSL
into Strings instead of leaving them as bytes.
Instead of these lines:
String xsl = new String(resource_manager.bytesForResourceNamed
(xslfile, null, null));
...
.... new StreamSource(new StringReader(xsl)...
Could you try something like:
InputStream aStream =
resource_manager.inputStreamForResourceNamed(xslfile, null, null)
StreamSource xsl = new StreamSource(aStream);
And instead of passing your XML in as a String ("String xml"), use
the XML Node class. Then you can set up the transform on the DOM
directly:
transformer.transform(new DOMSource(xml), output);
This should remove your character problems.
Steve
On Tue, 10 Oct 2006, Amedeo Mantica wrote:
Thank you for reply and collaboration
here the link for dile downloads
http://downloads.insigno.net/fileswo.zip
the sourceXML is the XML data grabbed from database (using
WebObjects's NSXMLOutputStream)
the file is perfect. (some /u000d for CR/LF, but I think is ok)
the SimpleTrasformation.xls is an Apple provided XLST file for
removing unuseful data and simplyfing the XML file.
the destinationXML file is the result of sourceXML trasformed
using SimpleTrasformation.xml
myTrasformer.java is the routine that do the XSLT trasformation.
see the accented letters in destinationXML file...
Regards
Amedeo
On 09/ott/06, at 21:23, Travis Cripps wrote:
Hi, Amadeo.
Would you mind sending me your xslt file, your xml file, and a
sample of the data output by your xml serializer (object->xml tag
mapping) file?
Travis
On Oct 9, 2006, at 6:08 AM, Amadeo Mantica wrote:
Date: Mon, 9 Oct 2006 11:58:54 +0200
From: Amedeo Mantica <email@hidden>
Subject: Need Help - problem with XSLT Trasformations - was problem
generating PDF using FOP
To: WebObjects Dev Apple <email@hidden>
Message-ID: <2C76513F-937B-449D-
email@hidden>
Content-Type: text/plain; charset="us-ascii"
Hi all,
I have my data storage on a OpenBase SQL server and data is
stored un
UTF-8 format.
The web applications works fine ( I overrided the appendToResponse,
takeValuesFromRequest and dispatchRequest methods in
Application.java
for setting the encoding to UTF-8).
You can see my work at:
http://www.ivc.it
http://www.muratti.it
http://www.azimutcoatings.com
http://www.pennellificiopuma.it
http://www.lineabird.it
http://www.lineahex.it
http://www.anticasignoria.it
These are seven websites, but is an unique WebObject applicatiion
that select correct products, graphics, text and css based on
selected site and language.
Now I need to export PDF tacnical sheet of products.
I followed the great Sasha an Chuck's book "Practical
WebObjects" for
serializing my data in XML format, then trasforming to PDF using
Apache FOP.
Exporting data from EO to XML works fine. First XML become UTF-8
encoded.
When I do the "SimpleTrasformation" with XSLT provided by Apple
(where the Output Format is set UTF-8), I got bad data encoding,
and
all accented letters are bad.
Then trasforming again using apache FOP produce really bad results.
I tried to do the "SimpleTraformation" using a software (TestXSLT,
http://www.entropy.ch/software/macosx/#testxslt ), a simple MacOS X
app that get in input the original XML and the XLST, and outputs
the
trasformed XML. It works fine, no encoding trouble.
So I think the trouble is inside the Java trasformation engine,
but I
don't know how to fix.
Can you help me?
Thanks
Regards
Amedeo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden