Re: [xsl] How to take a QName value and make it an attribute?

Subject: Re: [xsl] How to take a QName value and make it an attribute?
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Wed, 1 Aug 2012 16:47:50 +0100
> If it's not schema-aware, then you want:
>
>
>     <xsl:template match="fault">
>         <xsl:copy>
>             <xsl:variable name="q" as="xs:QName" select="resolve-QName(.,
> .)" />
>             <xsl:attribute name="{local-name-from-QName(q)}"
> namespace="namespace-uri-from-QName(q)">blah</xsl:attribute>
>

Or to reuse the same 'soap' prefix do:

<xsl:attribute name="{$q}"
namespace="{namespace-uri-for-prefix(prefix-from-QName($q), .)}">


-- 
Andrew Welch
http://andrewjwelch.com

Current Thread