[dsdl-discuss] Namespace renaming

From: Martin Bryan <martin@is-thought.co.uk>
Date: Sun Dec 04 2005 - 19:41:22 UTC

During the Atlanta meeting one of the tasks assigned to me as editor of DSRL
was to add namespace renaming to Part 8. (In fact the scope of Part 8
already includes the statement "including the assignment of element and
attribute names to different namespaces".)

I had originally thought that this would be a simple task, but now I am not
so sure. There are a number of problems, each of which raises specific
issues. The tasks required include, but are not limited to:

a) assigning all elements in a source namespace (e.g. HTML) to an
alternative namespace (e.g. XHTML) which has a different URI
b) assigning all elements with a specific prefix to a different prefix,
without changing the URI
c) assigning specific elements to a different namespace with a the same (or
a newly defined) URI to avoid name clashes
d) assigning specific attributes to a different namespace so that their
original ones can be used for new purposes (I actually came across this use
case last Friday, where I wanted to replace a user-assigned ID with a
system-assigned one, with the user-assigned ID being preserved as a
different attribute in a specific namespace).

Case a) would seem to require something along the lines:
<dsrl:change-namespace-prefix source="html" source-URI="...." target="xhtml"
target-URI="..."/>
The only question is to whether this is valid as it does not declare either
of the namespaces themselves. Should we be using:
<dsrl:change-namespace-prefix source="html" xmlns:html="...." target="xhtml"
xmlns:xhtml="..."/>
instead?

A problem with the latter approach is that I am not sure it can be used with
case b), where it would be necessary for two prefixes to be supplied to the
same URI. Is there any reason why XML would forbid this? Is is deemed
acceptable practice? Do we need to specify the namespaces as being
namespaces?

We already have a mechanism for case c) in the dsrl:element-name-map option,
where we can have one of three representations, such as
<dsrl:element-name-map>xyz:new-element-name</dsrl:element-name-map>. My only
question in this case is whether there needs to be some control on the
namespaces used, and what form this control should take. Should we require
that all namespaces referenced in a map be declared within it so that we can
ensure that correct URI occurs in the transformed file? If so should the
references be allowed to have local scope, or should they be global? Or
should we assume that the DTD/Schema used to validate the result will
declare the namespace URI that matches the prefix used in the map (can it do
so?)

The problem of scoping is even more critical for attribute redefinition. At
what point should the URI be declared for the prefix? Should the renaming
redefine it on every mapped element, only on the root element, or will some
form of inheritance checking need to be used to check whether the prefix/URI
pair is already in force at this point? (This last option seems to me to be
difficult to require as we are supposed to be doing things declaratively,
and I was hoping to be able to do transformations using XLST 2.0).

Suggestions as to the best ways of meeting this new requirement would be
very much welcomed.

Martin

--
DSDL members discussion list
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-discuss-request@dsdl.org
(mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
Received on Sun Dec 4 20:41:53 2005

This archive was generated by hypermail 2.1.8 : Mon Dec 05 2005 - 03:33:01 UTC