You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Emmanouil Batsis <ma...@geekologue.com> on 2005/04/02 09:08:09 UTC

TransformerHandler serialization problems

Probably a stupid question but i would really appreciate some help :-/

In my implementation of XMLReader, i fire events like 

contentHandler.startElement(namespaceURI, localName, "", null);

to the TransformerHandler used as ContentHandler obtained from the code at [1] 
with an empty string as the element name

< attribute1="value"...

I'm pretty sure i have to make the TransformerHandler instance namespace aware 
(i.e. use the namespace URI and local name params and ignore the empty QName) 
but cannot figure out how to do that. Here's how i get my TransformerHandler, 
i dont use an actual XSLT as i only want to serialize from SAX 2 events:

[1]

TransformerFactory transFact = TransformerFactory.newInstance();
SAXTransformerFactory tf = (SAXTransformerFactory) transFact;
TransformerHandler handlerhandler = tf.newTransformerHandler();
Transformer transformer = handler.getTransformer();
transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
transformer.setOutputProperty(OutputKeys.INDENT, indent ? "yes" : "no");
handler.setResult(streamResult);


    


Re: TransformerHandler serialization problems

Posted by Emmanouil Batsis <ma...@geekologue.com>.
On Saturday 02 April 2005 10:08, Emmanouil Batsis wrote:

> to the TransformerHandler used as ContentHandler obtained from the code at
> [1] with an empty string as the element name
>
> < attribute1="value"...

Please read: 

to the TransformerHandler used as ContentHandler obtained from the code at
[1], but the serialized XML element appears with an empty string as the 
element name

< attribute1="value"...



Thanks,

Manos