[MOBY] [MOBY-l] XML namespaces

Mark Wilkinson markw at illuminae.com
Sun Oct 19 09:06:36 EDT 2003


On Sun, 2003-10-19 at 00:35, Ken Steube wrote:
> Some of our services return <GenericSequence ...> which others retrn
> <moby:GenericSequence ...>.

if you are using the MOBY::CommonSubs library (or if you are following
the 0.5 API) the header of a Response is:

<?xml version='1.0' encoding='UTF-8'?>
<moby:MOBY xmlns:moby='http://www.biomoby.org/moby'>

therefore, both designations are valid and correct XML.

> Since we're using an XML parser that doesn't observe XML namespaces
> shouldn't we standardize?

Eeeeeek!  No way!  I don't want the wrath of God to be on my head for
assigning arbitrary new rules to a well defined standard like XML!!

The correct thing to do is to fix the code, not break the XML standard
:-)

> I'll suggest we don't use 'moby:'. Later on if we find that 'moby:' is not
> present we can assume the default namespace. Besides, we don't validate
> our objects anyway so is there a need for XML namespaces at all?

Since we can't predict what XML parser/generator any given person is
using, and since both tagname formats are valid XML, we must allow
both... if not, then we are not really using XML, but rather some
arbitrary XML-like set of rules (and then we are dead in the water!)

It's painful right now because of my early error in using XML::DOM, but
it's a pain we have to live through until someone finds the time to
re-code everything with e.g. XML::LibXML or Xerces.

M

-- 
Mark Wilkinson <markw at illuminae.com>
Illuminae



More information about the moby-l mailing list