You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Phil Rice <ph...@conformNow.com> on 2002/02/20 10:48:24 UTC
Can the have a name attribute that is dynamic?
I have tried the following:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="*">
<xsl:element name="local-name()" />
</xsl:template>
</xsl:stylesheet>
I was expecting to get a single element with a name of the top element.
Unfortunately I got
<?xml version="1.0" encoding="UTF-8"?>
file:///C:/WINDOWS/jbproject/XMLTransformation/calls.xsl; Line 4; Column 38;
Illegal value used for attribute name: local-name()
When I replace the offending xsl:element line with <xsl:value-of
select="local-name()" /> I get:
<?xml version="1.0" encoding="UTF-8"?>
PHONE_RECORDS
As I understand the specification:
"The xsl:element instruction allows an element to be created with a computed
name. The expanded QName of the element to be created is specified by a
required name attribute and an optional namespace attribute."
I am probably being naive, but I would appreciate any help
Phil Rice