Next Round

james anderson James.Anderson at
Thu Jan 21 16:37:20 GMT 1999

yes, but...

Tyler Baker wrote:
> Don Park wrote:
> First, we will need to define a new type, namely Name.
> public interface Name {
>   String getPrefix(); // inappropriate
>   String getLocalName();
>   String getQualifiedName(); // inappropriate
>   String getNamespace();
>   String getExpandedName();
>   Name clone();
> }

Neither the prefix nor the qualified name have the same permanence as the
local name, the namespace and the expanded name. One could well collect all
prefixes in connection with which as symbol appeared, but the values are of no
use as the bindings have dynamic extent.
the prefix and the qualified name need to be handled separately, through an
interface which combines symbols (here called names) with a dynamic parsing or
serialization  context.

The other additions have to be modified accordingly: as the prefix has no
meaning outside of the parser's dynamic context, those interfaces have no purpose.

I know the spec gives you no binding for a prefix to a uri within the dtd, but
using the prefix is worse setting some binding rules and sticking to them.
Setting binding rules yields the same results as using the perfix in cases
which are unambiguous, offers a consistent interfaces, and - by virtue of the
bindings rules - at least yields defined results in cases where using the
prefix would yields an undefined result due to ambiguity. Three arguments for
the approach and none against.

> Then change the startElement method to:
> ...
this, for example, is defined only at the moment the element is being
processed. outside of the element's scope there is no defined result.
> String getTypeByQualifiedName(String prefix, String localName);
> // prefix + ':' + localName
> String getTypeByQualifiedName(String qualifiedName);

It would be better to use functions like the following (the results of which
are always defined) 

> String getTypeByExpandedName(String namespace, String localName);
> // namespace + ':' + localName
> String getTypeByExpandedName(String expandedName);

The former can be combined with a function to determine the uri bound to a
prefix - if need be. In my experience this latter function is of no use to an
application, as an application operates is better operating in terms of the
universal names only.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list