You're right.

But my transformer take a part of SAX events sent by the generator and parse it :

Here some lines of my transformer :

.....
public void endElement(String uri, String loc, String raw)
throws SAXException {
if (extractLevel == 0) {
super.endElement(uri,loc,raw);
} else {
this.currentBuilder.endElement(uri,loc,raw);
if (this.extractURI.equals(uri) && this.extractElement.equals(loc)) {
extractLevel--;
getLogger().debug("extractLevel now " + extractLevel + ".");
if (extractLevel == 0) {
// finish building the DOM. remove existing prefix mappings.
Iterator itt = prefixMap.entrySet().iterator();
while (itt.hasNext()) {
Map.Entry entry = (Map.Entry) itt.next();
this.currentBuilder.endPrefixMapping((String)entry.getKey());
}
this.currentBuilder.endDocument();
/**
* request in textml
*/
Document doc = this.currentBuilder.getDocument(); -> create the DOM document
String id = null;
String stringQuery = null;
ByteArrayInputStream my_string_as_stream = null;
InputSource input_source = null;


this.request = new StringBuffer();
try {
this.format.put(OutputKeys.ENCODING, "UTF-16");
id = org.apache.cocoon.xml.XMLUtils.serializeNode(doc, this.format); -> serialized the DOM to a String
this.request.append(id);


....

That doesn't work...the is still have the header ISO-8859-1 encoding.





At 14:45 10/03/2003 +0100, you wrote:
Lionel Crine <[EMAIL PROTECTED]> writes:

> I'd like to change the default encoding in my custom transformer, how
> can I do that ?

How is a transformer related to encoding? It's a internal
component and is working on java strings only (unless it is
reading additional data  from a external source).
Set the encoding in your serializer.

Martin


--------------------------------------------------------------------- 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]



Reply via email to