Re: [xsl] namespaces

Subject: Re: [xsl] namespaces
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sat, 23 Jun 2001 12:28:05 +0100
Hi William,

> While in the middle of processing a XSLT tempalte, I have a declared
> namespace URI, but I do not have the shorthand. Is there anyway to
> get the shorthand back and stick it into a variable?

If the current node is an element, then you can get to information
about the namespaces that are in scope for that element using the
namespace:: axis.  The value of a namespace node is the namespace URI,
and its name is the prefix (the shorthand, as you call it).

So, if you're in a template where the current node is an element and
the namespace is in scope on that element, then you can get the prefix
associated with the namespace '' with:

  name(namespace::*[. = ''])

I hope that's what you were after,


Jeni Tennison

 XSL-List info and archive:

Current Thread