xsl-list
[Top] [All Lists]

Re: [xsl] Select name of XSD targetNamespace attribute

2014-03-29 16:01:02
I tried your example David and the WinRT Xslt process throws an error
at local-name():

NodeTest expected here.
namespace::*[.=current()/@targetNamespace]/-->local-name<--()

If i remove the local-name() part I get back the value of the
correctly selected namespace. So does this error indicates MS is
indeed still using XPath 1.0 in their 2014 API?

On Fri, Mar 28, 2014 at 4:52 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
On 28/03/2014 15: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!



If I edit your input to say test in both cases then

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:xs="http://www.w3.org/2001/XMLSchema";>


<xsl:template match="xs:schema">
<xsl:value-of
select="namespace::*[.=current()/@targetNamespace]/local-name()"/>
</xsl:template>

</xsl:stylesheet>

outputs "foo"

David


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