You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Tom Amiro <To...@Sun.COM> on 2002/07/31 14:15:22 UTC

identity transform

Hi,

Here is an exchange that is best answered on this alias.

Tom

Edwin Goei wrote:

> Anil Vijendran wrote:
>
>> Can someone in jaxp land tell us if the Xalan identity transformer preserves everything (spaces, tabs etc) in the case of a stream to stream transformation?
>
>
> I would guess that it does not because the input XML stream is parsed into a SAX stream and then serialized out again as an XML stream.  So the infoset is preserved, but not the actual XML stream.
>
> For example, the input XML stream could be in one encoding and the output could be another.

You are most probably right.

Unfortunately preserving the infoset is not enough for technologies such as XML signatures. And JAXP does not have any other means by which you can output a Source to a stream.

In fact I looked up the javadocs and it says:


public abstract Transformer newTransformer()
                                    throws TransformerConfigurationException

Create a new Transformer object that performs a copy
 of the source to the result.

There is a clear notion of an identity transform in the APIs, but either it is underspecified or Xalan decided to interpret "copy" to mean "copy of the infoset".

I did a stream to stream transform with a few simple variations and generally (but not always) it seems to preserve whitespace. Some more details on this from the Xalan developers would be great!

Thanks.

> The Xalan developers could give you more details.
>
> -Edwin
>

--
Peace, Anil +<:-)