Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Removing namespace declarations

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT ibiblio.org>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Removing namespace declarations
  • Date: Thu, 12 May 2011 14:29:04 -0400

On Mon, May 9, 2011 at 4:56 PM, Peter Murray-Rust <pm286 AT cam.ac.uk> wrote:
> I have been processing XOM using XInclude and have somehow ended up with
> XInclude namespace declarations on nodes, as in:
>
> <module xmlns="http://www.xml-cml.org/schema"; xmlns:xi="
> http://www.w3.org/2001/XInclude";>
>  ...
> </module>

Looks like your XInclude picked up some namespaces in scope.

> I'd like to get rid of them, ideally with XPath, but my reading of XOM
> suggests that I cannot obtain namespace declarations with XPath. If I can't
> do it this way is there a programmatic way of getting rid of them?
>

Should be. Assuming the namespace isn't actually used, then just call
element.removeNamespaceDeclaration("xi")

--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page