F
Filip Hendrickx
Hi there.
I want to generate elements, choosing the element name dynamically. So I
tried to use attribute value templates:
<xsl:element name="{$local-name($someNode)}">
<!-- Generate element content. -->
</xsl:element>
where $someNode is an XML tree.
This doesn't work: the xslt processor sees the attribute value template
as an illegal qname. However, when I print out this value using
xsl:value-of, it appears to be perfectly valid.
So I changed the first line into
<xsl:element name="p{$local-name($someNode)}">
(notice the extra 'p' before the avt)
This works (strangely enough to me), but is of course useless as I don't
want that extra 'p'. I get the same behavior in Saxon b8.6.1, Xalan J
2.7.0 and Msxsl 4.0.
I know there are work-arounds to get the result that I want, but does
anybody know why the first version doesn't work and the second does?
Thanks in advance.
Filip Hendrickx.
I want to generate elements, choosing the element name dynamically. So I
tried to use attribute value templates:
<xsl:element name="{$local-name($someNode)}">
<!-- Generate element content. -->
</xsl:element>
where $someNode is an XML tree.
This doesn't work: the xslt processor sees the attribute value template
as an illegal qname. However, when I print out this value using
xsl:value-of, it appears to be perfectly valid.
So I changed the first line into
<xsl:element name="p{$local-name($someNode)}">
(notice the extra 'p' before the avt)
This works (strangely enough to me), but is of course useless as I don't
want that extra 'p'. I get the same behavior in Saxon b8.6.1, Xalan J
2.7.0 and Msxsl 4.0.
I know there are work-arounds to get the result that I want, but does
anybody know why the first version doesn't work and the second does?
Thanks in advance.
Filip Hendrickx.