Namespace questions

Peter Murray-Rust peter at ursus.demon.co.uk
Thu Jul 2 18:56:23 BST 1998


Firstly, I think that there are a lot of questions about namespaces to
which the answers  are assumed but not written down in the spec. For some,
I suspect that most people will make the same assumptions, but for others
there may be differences of opinions.

It has been agreed that the XLink and other specs will have to be updated
to be namespace-aware. I think that until that is published we should
assume we are on thin ice.

At 18:04 02/07/98 +0200, james anderson wrote:
>i'm afraid i'm going to repeat myself, but ...
>
>Ron Bourret wrote:
>> 
>> 1) Can I have multiple prefixes in the same file that point to the same
>> namespace?  The namespace spec doesn't appear to prohibit this.
>
>from an implementer's point of view, "yes". different prefixes within the
same
>file should be able to denote the same region in the namespace.
>since all uses of a prefix are in single physical entity are "lexically
>apparent" this shouldn't lead to problems.
>since the namespace pi's can contain literals only, why would one need to
do it?

I agree that this is allowed. A possible use for it is that a document is
composed of contributions by more than one author who use different
prefixes. Example:

<?xml:namespace ns="xml-cml.org" prefix="CML"?>
<?xml:namespace ns="xml-cml.org" prefix="ChemML"?>

<CML:CML>
&doc1;
&doc2;
</CML:CML>

doc2 might contain ElementTypes of the form <ChemML:Molecule>

>
>> 
>> 2) How do namespaces and XLinks work together?  For example, suppose I
link to
>> the <Foo> element in another file.
>> 
>> a) If the <Foo> element is prefixed (that is, it is really <Bar:Foo>)
does my
>> pointer need to know this?
>
>the short answer is: "yes".

a slightly longer answer is "yes, but".

If the characters "<Foo>" appear in a file they cannot at present 'really
be "<Bar:Foo>"' (i.e. there is no scoping mechanism). I imagine that this
was not what was intended in the question, but wanted to make sure.

[...]
>
>
>> 
>> b) When I get the <Foo> element back as a result of resolving the link,
do I get
>> <Foo> or <Bar:Foo>?  And if I get <Bar:Foo>, do I also get a namespace PI
>> telling me about the Bar prefix?
>
This is a difficult area as it is (as ChrisM says) dependent on
implementation. You don't 'get anything back' other than a pointer or an
address (or a set of them). The spec for attr() [which at present returns a
String] is misleading [thanks to Steve De Rose, private mail] and will be
rewritten. If it returns anything it is to the address in (say) a grove
which includes attributes

	P.

Peter Murray-Rust, Director Virtual School of Molecular Sciences, domestic
net connection
VSMS http://www.nottingham.ac.uk/vsms, Virtual Hyperglossary
http://www.venus.co.uk/vhg

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




More information about the Xml-dev mailing list