![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Style sheet to move attributes into elements [Thread Next] Re: Style sheet to move attributes into elementsTo: NULL Date: 7/2/2004 9:23:00 AM Guys,
Thanks for you help. While I didn't use the exact XSL you posted, it got me
thinking outside the square. I managed to get it going with some pretty
complex logic, because I found that I actually had a third layer of nodes
that I needed to add as an attribute to the cells. Thanks again for your
input.
Aaron.
"Sarachan" <sarachan7_NOSPAM@l...> wrote in message
news:2OOEc.63511$G%.37049@t......
> Try with this XSL:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="xml" indent="yes"/>
>
> <xsl:template match="Table">
> <xsl:element name="Table">
> <xsl:apply-templates/>
> </xsl:element>
> </xsl:template>
>
> <xsl:template match="Row">
> <xsl:if test="@Item>0">
> <xsl:element name="Row">
> <xsl:for-each select="Member">
> <xsl:choose>
> <xsl:when test="@Name='Cell'">
> <xsl:variable name="thisposition" select="position()"/>
> <xsl:variable name="thisname">
> <xsl:value-of
> select="/Table/Row[@Item=0]/Member[$thisposition]/@Name"/>
> </xsl:variable>
> <xsl:element name="{$thisname}">
> <xsl:value-of select="@F"/>
> </xsl:element>
> </xsl:when>
> <xsl:otherwise>
> <xsl:element name="heading">
> <xsl:value-of select="@Name"/>
> </xsl:element>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:for-each>
> </xsl:element>
> </xsl:if>
> </xsl:template>
> </xsl:stylesheet>
>
> HTH
>
> Sarachan
>
>
> "Aaron" <aaron.nospam.rh@m...> ha scritto nel messaggio
> news:#8Y#OlYXEHA.2408@t......
> > Hi,
> >
> > I am wondering if anyone would know what sort of XSL I could use to make
> > this:
> >
> > <Table>
> > <Row Item="0">
> > <Member Name="" />
> > <Member Name="value" />
> > <Member Name="percentage" />
> > ...
> > </Row>
> > <Row Item="1">
> > <Member Name="Row Heading" />
> > <Member Name="Cell" F="1,475,778,152" />
> > <Member Name="Cell" F="100.00%" />
> > ...
> > </Row>
> > <Table>
> >
> > into this
> >
> > <Table>
> > <Row>
> > <heading>Row Heading</heading>
> > <value>1,475,778,152</value>
> > <percentage>100.00%</percentage>
> > ...
> > </Row>
> > </Table>
> >
> > Thanks in advance!
> >
> > Aaron.
> >
> >
>
>
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
