Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Need to preserver duplicate namespace declarations

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Aust, Stefan" <stefan.aust AT coremedia.com>
  • To: "Elliotte Harold" <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Need to preserver duplicate namespace declarations
  • Date: Tue, 9 Aug 2005 18:07:51 +0200

Elliotte Harold responded:

> > I need to compute a hash (and signature) over parts of the
> > XML. It's not XML DSIG compatible so there's no canonicalization
> > transformation here.
>
> Then you've got bigger problems than just namespace declarations.

I haven't told the whole story. There is a canonical form for everything
else - it's just that we need to preserve additional namespaces.

> There's a lot more in the original XML that is also not
> guaranteed to be preserved on roundtrip than simply the
> location of redundant namespace declarations. You really need
> to use XML DSIG

Unfortunately, I can't change the spec I have to implement.

> and you'd probably have more luck convincing
> me to add that to XOM than to maintain the exact location of
> additional namespace declarations in this unusual case.

JSE 6 will include DSIG support so in the long term it might be a good
idea.

Actually, I perfectly understand that you don't want to implement this
just for me but I'd greatly appreciate any hints how to best modify the
sources to minimize the impact.

My idea was to modify Element#addNamespaceDeclaration() to remember the
fact that is was an explicit addition. It looks like that method is only
called twice in XOMHandler and twice in NonVerifyingHandler (ignoring
DOMConverter and XSLTHandler). Now Element should get a new List of
declared prefixes. Then, I could ask an element whether the namespace
was declared here on in some parent element. Hopefully, that should do
the trick.

Regards,

--
Stefan Matthias Aust




Archive powered by MHonArc 2.6.24.

Top of Page