Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Canonicalization question

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
  • Date: Mon, 17 Oct 2005 15:59:21 +0200

Hi there,

I tried the XC14N implementation of XOM 1.1 b4. The attached test
application emits

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

However I think, it should emit

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

Is there a way to get my expected result which I have not found?

Thanks,


---8<----

public class A {
static String c(Node n) throws Exception {
ByteArrayOutputStream os = new ByteArrayOutputStream();
new Canonicalizer(os,
Canonicalizer.EXCLUSIVE_XML_CANONICALIZATION).write(n);
return os.toString("UTF8");
}

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

--
Stefan Matthias Aust




Archive powered by MHonArc 2.6.24.

Top of Page