Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Style sheet to move attributes into elements

From: "Aaron" <aaron.nospam.rh@---------.---.-->
To: 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&gt;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.
> >
> >
>
>




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent