Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - multi step transformation [Thread Next] RE: multi step transformationTo: NULL Date: 10/1/2004 3:15:00 PM i did this using msxsl nodeset to process fragments
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:template match="a">
<xsl:variable name="List">
<xsl:call-template name="SPLITTEMPLATE">
<!-- Assume your template simply splits the original <a>Tom
Dick harry</a> tag and returns a resulting tree fragment
<a>Tom</a><a>Dick>/a> etc-->
</xsl:call-template>
</xsl:variable>
<xsl:variable select="//b" name="b"/>
<xsl:for-each select="msxsl:node-set($List)/a">
<a>
<xsl:attribute name="b">
<xsl:value-of select="$b"/>
</xsl:attribute>
</a><xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
<xsl:stylesheet>
"wooks" wrote:
> have
>
> <a>tom
> dick
> harry
> peter</a>
> <b>typeforA</b>
>
> I want
> <a b="typeforA>tom</a>
> <a b="typeforA>dick</a>
> <a b="typeforA>harry</a>
> <a b="typeforA>peter</a>
>
> I have a generic split routine that works but to get the output I want
> b has to be an attribute of a before the split routine runs. The split
> routine will then add b as an attribute to each A it creates.
>
> Obviously I could do this easily in a 2 step transform -
>
> 1. transform b from an element to an attribute of A.
> 2. Run the split.
>
> But I want to do it in one transform. How?
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
