It seems to be lost here that I am not attempting to bind to the null namespace. I am attempting to bind a prefix to a non-null namespace that currently has no prefix because the document did not specify it with one.
Post by Michael KayPost by Regier Avery JBy this statement it seems that I should be able to create an alias
for a namespace that currently lacks one. Why make it hard?
It would be rather nice if we had pure symmetry in namespace bindings,
so you could bind the "null" prefix to either a "real" namespace or the
"null" namespace, and bind a "real" prefix to either a "real" namespace
or the "null" namespace. Unfortunately that isn't the way. Of these four
combinations, XML only allows three - it doesn't allow you to bind a
real prefix to the null namespace; and XPath 1.0 only allows two - it
doesn't allow you to bind a null prefix to a real namespace. XPath 2.0
does allow you to bind a null prefix to a real namespace (the "default
namespace for elements and types"), but it still doesn't allow the
fourth option, a real prefix bound to a null namespace.
There are a number of reasons for this asymmetry, none of them in my
mind very good reasons, but unfortunately there is a lot of emotional
baggage associated with namespaces, part of which is the insistence in
some quarters that what I call the "null" namespace is not actually a
namespace at all, but something quite different. The fact that the
engineering would be more convenient if we treated it as a namespace
that happens to have no name doesn't carry much weight with those who
attach metaphysical significance (aka "semantics") to such matters.
Michael Kay
Saxonica
Post by Regier Avery JIN general, though, why would you want to do that? Outside of the true ugliness of HTML/XHTML, I've never really seen a need for writing one expression to apply regardless of namespaces.
My immediate use is to translate from a simplified syntax sent over URLs to transform the document being returned from that URL. The client is always giving the path in the namespace associated with the one document returned. The service knows what those namespaces are.
I am specifically attempting to implement embed/fields for REST services as presented in
REST API Design Rulebook by Mark Mass?
(O'Reilly). Copyright 2012 Mark Mass?, 978-1-449-31050-9
Chapter 6, pp 73-77, "Response Representation Composition"
I am working through trying to use the new XOM and make all my tests pass again. It really threw a spanner in the works.
Avery J. Regier
RegierAveryJ at JohnDeere.com
-----Original Message-----
From: xom-interest-bounces at lists.ibiblio.org [mailto:xom-interest-bounces at lists.ibiblio.org] On Behalf Of Elliotte Rusty Harold
Sent: Monday, May 14, 2012 12:49 PM
To: XOM API for Processing XML with Java
Subject: Re: [XOM-interest] XOM 1.2.8 released
As Michael surmised, that's a deliberate bug fix. You should no longer
need to bind anything to the default namespace.
_______________________________________________
XOM-interest mailing list
XOM-interest at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest