xsl-list
[Top] [All Lists]

Re: [xsl] Select name of XSD targetNamespace attribute

2014-03-28 10:53:46
Hi Philipp,

xmlns:foo is a namespace declaration, not an attribute (and they have
very different semantics). You can find the namespaces available on an
element by using fn:in-scope-prefixes for the prefix (it will return all
prefixes, including 'foo') and fn:namespace-uri-for-prefix() on those
prefixes to find the namespace uri (the value of xmlns:prefix) belonging
to such prefix.

These functions are available in XPath 2.0 and 3.0. I am not sure
whether you can get the same information using XPath 1.0 (you didn't
specify what language you used, so I assumed 2.0).

Cheers,

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


On 28-3-2014 16:44, Philipp Kursawe wrote:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.foo.com/test";
xmlns:foo="http://www.foo.com/text";
xmlns:xs="http://www.w3.org/2001/XMLSchema"; version="0.1.1.0">
</xs:schema>

I want to find out the name of the attribute that describes the
targetNamespace ("xmlns:foo") or even better "foo"

Thanks!

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--