Myriam,
Joseph,

Some more information I could gather... maybe it'll talk more to you than me
as I have some trouble understanding all it all works.

anyway here it goes.

1?) As Joseph noted, the XML serialzer can output the namespaces without
reliyng on start/end prefix mapping. But it means that the prefixes are
passed as attributes. After some more check of the code (and some time in
the debugger), I could see that the XML serializer is indeed working OK
without any patch, as long as it gets the namespaces as attributes.

2?) When Xalan applies a stylesheet, it puts the namespaces as attributes
(where and how I could not find, sadly), which means the XML serializer is
working OK when called after the transformation of a stylesheet. However
when a Transformer is requested without a stylesheet (i.e. through
SAXTransformerFactory.newTransformerHandler()) then it does not seem (again
could not find evidence in code) to convert the namespaces to attributes (in
fact is uses the TransformerIdentityImpl... where the problem might be.). If
I run my application with an identity stylesheet it works (I mean I get
namespaces in my xml output), If I rely on the identity transform of
newTransformerHandler, it does not work (no namespace in output).

3?) I still wonder about namespaces as attributes, Xalan does it that way,
Xerces (1.4.2) does not...

Thanks for reading, I hope it helps to pinpoint the problem.

Michel.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 25 July, 2001 22:47
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: Namespaces are ignored in SerializerToXML...
>
>
>
> >And the SerializerToXML.startPrefixMapping method is still empty so I
> >guess it did not fix the problem.
>
> The fact that the serializer ignores the start/endPrefixMapping calls
> doesn't necessarily mean it "ignores namespaces". All the information
> _should_ be available from the startElement and endElement calls, and the
> serializer ought to be able to do the right thing.
>
>
> > Is it correct to consider 'xmlns:java' an attribute ???
>
> Yes. Note that the prefixMapping feature of SAX is documented (in
> http://xml.apache.org/xalan-j/apidocs/org/xml/sax/ContentHandler.html) as
> something most applications won't need. It's primarily intended to support
> handling of prefixes that appear inside document _content_.
>
> The serializer isn't doing anything along those lines, so discarding these
> events is perfectly reasonable and the fact that this method is empty is
> probably not a bug.
>
> That doesn't necessarily mean that nothing's wrong. It does mean we should
> take a step back and get a testcase that demonstrates the real problem,
> then use that to determine whether the bug is in the serializer or in the
> data being fed to the serializer.
>
> What's happening that shouldn't be, and how can we reproduce it for
> analysis?
>
>
>
>

Reply via email to