You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Warren, David" <dw...@rsasecurity.com> on 2003/04/17 04:34:59 UTC

RE: empty xmlns attribute (resolved)

Thanks to Joe and Simon for their suggestions.  I've finally figured
out what is going on and I think that its obscure enough that others
may benefit.

In essence, the additional attribute (xmlns="") *was* being added by a
serializer (Joe was right!).  What was happening was that I was
using Apache XML Security's (xmlsec) canonicalizer to output the
Element I had just created.

I had assumed that the canonicalizer would only read the Element but
it turns out that this canonicalizer modifies the Element by adding
this attribute.

My code was simple and I was using xerces and xmlsec and I picked the
wrong list to ask the question about what was happening.  However, thanks
to your responses I realized that I should investigate xmlsec more closely.

So I asked about this on the xmlsec list.  Christian Geuer-Pollmann says 
that this behavior was added as a workaround to a xalan bug
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2650).  BTW, I
found that Joe had made a contribution to this bugzilla report.

A nasty side-effect of this behavior is that the canonicalizer throws an
exception if you try to canonicalize the same Element again without
removing the extra attribute.

Joe Kesselman wrote:
> On Wednesday, 04/16/2003 at 11:10ZE12, Simon Kitching
<si...@ecnetwork.co.nz> wrote:
> > (b) creating a node, writing a document to a file, then parsing the file
> > and detecting extra attributes?
> > 
> > I suspect that Joe assumed (b), hence the reference to a "serializer".
> 
> That's correct, since -- as far as I know -- implied namespace
> declarations will not be automagically created until you serialize (or
> until you run DOM Level 3 Namespace Normalization). 

Thanks for the help.
David
--
Obligatory .signatory
David Warren
RSA Security Inc., 174 Middlesex Turnpike, Bedford, MA 01730




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org