Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 1.2.8 released

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Michael Kay <mike AT saxonica.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM 1.2.8 released
  • Date: Mon, 14 May 2012 21:34:38 +0100

>By 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
IN 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.





Archive powered by MHonArc 2.6.24.

Top of Page