xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] FIXED Unexpected NamespaceConflictException when adding xsi:schemaLocation attribute
- From: lenards AT email.arizona.edu
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] FIXED Unexpected NamespaceConflictException when adding xsi:schemaLocation attribute
- Date: Tue, 29 Jul 2008 17:49:08 -0700
I knew I should have waited to send my message...
I found a snippet of XOM code with a google search so I tried it:
Element root = new Element(PageContentElements.ROOT_RESPONSE, NS);
root.addNamespaceDeclaration("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
root.addAttribute(new Attribute("xsi:schemaLocation",
"http://www.w3.org/2001/XMLSchema-instance",
"http://www.foo.org/transfer/content/0.1
http://services.foo.org/schema/content_0_1.xsd"));
No exception and the attribute is added as expected.
I thought the code felt redundant. So I pulled out the namespace decl:
Element root = new Element(PageContentElements.ROOT_RESPONSE, NS);
root.addAttribute(new Attribute("xsi:schemaLocation",
"http://www.w3.org/2001/XMLSchema-instance",
"http://www.foo.org/transfer/content/0.1
http://services.foo.org/schema/content_0_1.xsd"));
And that works too.
From a blackbox perspective, I'm still a little puzzled as to why the code I had
was caused an exception?
What's the idea behind that code causing an exception?
I guess I should just look at the source... but I'm curious the thoughts of
those on the list.
Andy
-
[XOM-interest] Unexpected NamespaceConflictException when adding xsi:schemaLocation attribute,
lenards, 07/29/2008
-
Re: [XOM-interest] FIXED Unexpected NamespaceConflictException when adding xsi:schemaLocation attribute,
lenards, 07/29/2008
- Re: [XOM-interest] FIXED Unexpected NamespaceConflictException when adding xsi:schemaLocation attribute, Elliotte Harold, 07/30/2008
-
Re: [XOM-interest] FIXED Unexpected NamespaceConflictException when adding xsi:schemaLocation attribute,
lenards, 07/29/2008
Archive powered by MHonArc 2.6.24.