[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Select name of XSD targetNamespace attribute

Subject: Re: [xsl] Select name of XSD targetNamespace attribute
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 Mar 2014 15:52:10 +0000

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:xs="http://www.w3.org/2001/XMLSchema" version="">

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


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"

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


outputs "foo"


Current Thread