Query about namespaces with Scala XML

No replies

Thu, 2009-10-22, 18:43

Mark Howe

Joined: 2009-10-22,

Hi,

I'm considering tacking an XML project using Scala. There's a lot I like
about what I've read, including not treating XML as strings, code
interpolation and integration with Scala pattern matching. My major
concern at present, from

"The current implementation will not properly stratify namespace
bindings when elements from different scopes are combined. This is not a
problem when querying or processing XML data, but it might lead to wrong
namespace bindings when serializing XML. A modified version of the
serializing algorithm can solve the problem by introducing namespace
declarations and undeclarations in the right place. Since it seems a
rare problem and developers can stratify namespaces themselves in a
given XML application, your humble author and scala.xml maintainer did
not consider this issue a priority."

Assuming I understand "stratify" correctly in this context, I can see
that there isn't much of a problem if you are working with your own XML.
But for more generic XML processing where documents may enclose other
documents that use the same prefix as the enclosing document for
different namespaces, or a different prefix to the enclosing document
for the same namespace, an application by application solution seems far
from ideal to me.

So I was wondering how hard it would be to make Scala XML handling fully
compliant in this respect, and if there are any plans to do so.