There may be more than one prefix bound to a given namespace URI, but
name(namespace::*[.=$uri][1])
will give you the first one.
Alternatively use substring-before(name(.), ':')
Michael Kay
# -----Original Message-----
# From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
# [mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
Munna D
# Sent: 19 March 2004 12:42
# To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
# Subject: [xsl] getting the namespace prefix
#
# Hi,
# I know we can get the local name of an element with the
# local-name() function, and the namespace-uri with the
# namespace-uri() function, however, given the namespace uri,
# is there a way I could find out the namespace prefix used for
# a particular element? ie, say I know that the namespace uri
# for a particular element or set of elements is
# "http://purl.org/atom/ns#", is there a way to pick up the
# namespace prefix used on those elements?
# Thanks,
# Munna
# --
# _______________________________________________
# Get your free email from http://www.iname.com
#
#
# XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
#
#
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list