xsl-list
[Top] [All Lists]

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

2012-08-01 10:47:59
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

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