Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Canonicalization question 2

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: <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Canonicalization question 2
  • Date: Fri, 21 Oct 2005 11:02:49 +0200

Hi Elliotte,

Thanks for addressing my first C14N problem so fast. Here's another
problem I stumbled across.

public static void main(String[] args) throws Exception {
Element e1 = new Element("a:a", "urn:a");
//e1.addAttribute(new Attribute("a", "a"));
Element e2 = new Element("b");
e1.appendChild(e2);
System.out.println(c(e1));
}

This prints:

<a:a xmlns:a="urn:a"><b xmlns=""></b></a:a>

But I think, it should print:

<a:a xmlns:a="urn:a"><b></b></a:a>

Because if you uncomment the attribute definition it will print

<a:a xmlns:a="urn:a" a="a"><b></b></a:a>

But frankly, I read the chapter 3 of the exc-c14n spec twice and still
did not understand the rules for xmlns="". The "" namespace doesn't
occur in the inclusive namespaces prefix list, so (3) applies. 3.1
applies because element b is in the node-set. 3.2 applies because it is
visible utilized (b has no prefix) in b. 3.3 applies (in the case with
attribute) because the empty namespace hasn't rendered yet. However, I
think, (4) applies, because xmns="" is of course the default namespace,
so (3) cannot be applied. 4.1 applies, I don't fully understand 4.2 and
I think, that 4.3 DOES NOT apply, because there is no nearst output
ancestor that visibly utilize the default namespace.

--
Stefan Matthias Aust




Archive powered by MHonArc 2.6.24.

Top of Page