Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: creating new element from element [Thread Next] Re: creating new element from elementTo: NULL Date: 10/4/2008 6:26:00 PM
Dimitre Novatchev wrote:
>> <xsl:template match="FirstSecondThree">
>> <xsl:variable name="re" select="'\p{Lu}\p{Ll}+'"/>
>> <xsl:variable name="name-items" as="xs:string+">
>> <xsl:analyze-string
>> select="local-name()"
>> regex="{$re}">
>> <xsl:matching-substring>
>> <xsl:sequence select="."/>
>> </xsl:matching-substring>
>> </xsl:analyze-string>
>> </xsl:variable>
>> <xsl:call-template name="nest-elements">
>> <xsl:with-param name="name-items" select="reverse($name-items)"/>
>> </xsl:call-template>
>> </xsl:template>
>
> Martin,
>
> you already know that the element name is exactly "FirstSecondThree".
>
> Therefore, no further analysis (splitting) is necessary, just create an
> element named "Three" with a child named "Second" with a child named
> "First".
You are right, using template match="FirstSecondThree" and then trying
to split the name is not necessary. But I suppose the original poster
wanted something like
<xsl:template match="element/*">
and then split the names of those elements.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
