This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: namespaces
- To: William Lam <xeenman at yahoo dot com>
- Subject: Re: [xsl] namespaces
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Sat, 23 Jun 2001 12:28:05 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <20010622225151.57122.qmail@web14505.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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 'http://www.known.com' with:
name(namespace::*[. = 'http://www.known.com'])
I hope that's what you were after,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list