Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Scope of namespaces

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: peter murray-rust <pm286 AT cam.ac.uk>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Scope of namespaces
  • Date: Sun, 05 Feb 2006 19:23:13 -0500

peter,

You've hit a major flaw in namespaces. There's nothing XOM can do to solve this. Any solution we follow including the current one has nasty, surprising consequences for some use cases. The simple fact is that namespace prefixes in attribute values are evil, and will cause problems, no matter which API you use, no matter how you treat them. Sad but true.

We went around and around on this issue (in scope vs. declared) a couple of years ago, and there just doesn't seem to be a good way around it. I eventually decided that the least surprising approach was that detached elements would not automatically carry with them the namespace bindings of their ancestors. Doing so would:

1. Make detaching a very expensive operation

2. Surprise people who expected the namespace bindings of the new location to rule

This is especially true if you consider that it's not just the presence but the absence of bindings for a particular prefix you have to consider.

I wish I had a better answer for you, but there's just no way around this ugliness in namespaces. All I can suggest is remove the prefixes in attribute values if possible and if not then make sure you always use the same prefixes.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page