Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Creating a dynamic element name from one of its children elements >Thread Next - Re: Creating a dynamic element name from one of its children elements Re: Creating a dynamic element name from one of its children elementsTo: NULL Date: 12/12/2007 4:16:00 PM
brc wrote:
> I want to set the name of an element to the value of one of its child
> elements (the 'name' element) in a XSL stylesheet. See below.
>
> <xsl:template match="ns:well">
> <xsl:element name="{?????}">
> <ns:name><xsl:value-of select="ns:name"/><ns:name>
> <ns:wellType><xsl:value-of select="ns:wellType"/>
> .
> .
> .
> </xsl:element>
> </xsl:template>
>
> So what do I need to substitute for the ????? so that the elements
> name will be set to
> the name of the "name" element it includes?
There is a function named 'name' so
<xs:element name="{name(ns:name)}">
might do what you want, on the other hand I am not sure why xsl:element
is needed if you know the name you want.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
