xsl-list
[Top] [All Lists]

Re: [xsl] Select name of XSD targetNamespace attribute

2014-03-28 11:19:17
I must confess, I hardly ever use the namespace axis, and this is a fine
example of its use!

That said, do note that the namespace axis was deprecated as of XPath
2.0, so for the sake of completeness, here is a version without the
namespace axis, using the functions I described in that other mail in
this thread:

<xsl:value-of select="
    in-scope-prefixes(.)[
        current()/@targetNamespace =
        namespace-uri-for-prefix(., current())]"/>

but clearly not as concise as David's version.

Cheers,

Abel Braaksma
Exselt XSLT 3.0 processor
http://exselt.net


On 28-3-2014 16:52, David Carlisle wrote:
<xsl:template match="xs:schema">
<xsl:value-of
select="namespace::*[.=current()/@targetNamespace]/local-name()"/>
</xsl:template>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--