Re: [xsl] namespace issue

Subject: Re: [xsl] namespace issue
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 11 Dec 2001 16:28:46 +0000
Hi Dave,

>> If by empty ns you meant empty namespace name rather than empty
>> prefix then that is special in that it can only be assigned to the
>> default namespace (ie the empty prefix) you can't assign a non
>> empty prefix to the non-namespace.
> I've now read that eight times and I'm off to let me head heal.
> I think it means
>   <el xmlns="">  == the default namespace, is 'special' 
> I think the double negative means I can't do <pre:el xmlns="">

Not quite.

The namespace name is the namespace URI used to identify the
namespace, our favourite example being
"";. An empty namespace name ("")
means 'no namespace' or 'null namespace'.

The namespace prefix is the character(s) that you associate with the
namespace URI within a particular document. We usually use 'xsl' as
the namespace prefix for the XSLT namespace, for example. An empty
namespace prefix is what you use with the default namespace - element
names without a prefix (with an empty namespace prefix) are in the
default namespace.

What David said that you can't assign a non-empty namespace prefix to
an empty namespace name. That means you can't do:

  <el xmlns:pre="">...</el>

You can, however, assign an empty namespace prefix to a non-empty
namespace name (that's what you do when you create a default

  <el xmlns="my-namespace">...</el> or

You can also assign an empty namespace prefix to an empty namespace
name, and, of course, a non-empty namespace prefix to an non-empty
namespace name:

  <pre:el xmlns="" xmlns:pref="my-namespace">...</pre:el>

I hope that helps,


Jeni Tennison

 XSL-List info and archive:

Current Thread