Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: roblem with XSLT Trasformations - was problem generating PDF using FOP



Amadeo,

Hi. I created a sample project from your files, and was initially getting the same result, with the characters in the file resulting from your transform being messed up.

I changed all instances of String -> byte[] and byte[] -> String conversions to specify the character encoding and the resulting xml was perfect.

The basic changes were to read the xml and xsl into Strings like this:

String sourceXML = null;
byte[] bytes = WOApplication.application().resourceManager ().bytesForResourceNamed("sourceXML.xml", null, null);
try {
sourceXML = new String(bytes, "UTF-8");
} catch (UnsupportedEncodingException uee) {
uee.printStackTrace();
}


and to get the result of the transformation like this:

try {
result = ((ByteArrayOutputStream)((StreamResult) output).getOutputStream()).toString("UTF-8");
} catch (UnsupportedEncodingException uee) {
uee.printStackTrace();
}


I've posted the simple project to http://apparentmotion.com/ downloadables/XSLTest.zip. (47 KB)

Have a great day.

Travis

On Oct 10, 2006, at 3:36 AM, 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...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: roblem with XSLT Trasformations - was problem generating PDF using FOP (From: Amedeo Mantica <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.