XSLT: Computing the name of a generated element

M

Manuel Collado

I want to generate an element tag with the name of the parent of the
actual node. I've tried:

<xsl:element name="name(..)">
and <xsl:element name="../name()">

But the generated output is:

<name(..)> ... </name(..)>
or <../name()> ... </../name()>

So the specified element's 'name' is taken literally. Is there a way to
get it computed, instead of being a fixed literal?

Thakns,
 
J

Johannes Koch

Manuel said:
I want to generate an element tag with the name of the parent of the
actual node. I've tried:

<xsl:element name="name(..)">
and <xsl:element name="../name()">

But the generated output is:

<name(..)> ... </name(..)>
or <../name()> ... </../name()>

So the specified element's 'name' is taken literally. Is there a way to
get it computed, instead of being a fixed literal?

name="{some expression}"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top