W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: namespaces and DTD interactions

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Tue, 20 Mar 2001 16:18:38 -0500
To: www-dom@w3.org
Message-ID: <OFD60349D5.71EA6753-ON85256A15.007464E0@pok.ibm.com>

Attributes in XML files do not inherit namespaces, nor do they pick up the
default namespace; if you want an Attr to be namespaced, you must use an
explicit prefix and define that prefix. See the Namespaces specification.

It is possible to use the DOM APIs to explicitly create an Attr which has a
Namespace but does not have a prefix. It is the serializer's reponsibility
to repair this situation when you write that document out as XML syntax.
Typically it will either find and use an existing prefix for that URI, or
synthesize and declare a new one, or ask the user for guidance. Since the
DOM does not yet define serializer behavior, nor provide a check for
namespace-well-formedness, nor provide namespace-to-prefix or
prefix-to-namespace lookup operations, we have not yet expressed any
opinion regarding which of these options is preferred. DOM Level 3 will add
some of those functions, and may or may not recommend specific solutions.

______________________________________
Joe Kesselman  / IBM Research
Received on Tuesday, 20 March 2001 16:18:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT