|
Subject: Re: [xsl] Applying template conditionally From: Dan Diebolt <dandiebolt@xxxxxxxxx> Date: Fri, 27 Apr 2001 13:42:59 -0700 (PDT) |
>Sorry :( I was trying not to make the post too long,
>and was hoping my description of the problem would be
>sufficient.
I simplified your problem to just transforming your cell's
children & attributes to attributes of row. My solution
is a bit inelegent but I still don't understand what you
want done with all of the ExtendedAttribute pieces, what
you want the attributes named or if you have to dynamically
create the attribute names.
Regards,
Dan
File: Spreadsheet27April2001.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Spreadsheet27April2001.xsl"?>
<root>
<row>
<cell column="1">*OrganizationCode</cell>
<cell column="2">*RFQName</cell>
<cell column="3">*RFQCode</cell>
<cell column="4">*RFQType</cell>
<cell column="5">*RFQSubscription</cell>
</row>
<row>
<cell column="1">abc</cell>
<cell column="2">00Test Import 3</cell>
<cell column="3">00Test Import 3</cell>
<cell column="4">reverse</cell>
<cell column="5">public</cell>
</row>
</root>
File: Spreadsheet27April2001.xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="root"/>
</xsl:template>
<xsl:template match="root">
<xsl:copy>
<xsl:apply-templates select="row"/>
</xsl:copy>
</xsl:template>
<xsl:template match="row">
<xsl:copy>
<xsl:apply-templates select="cell[@column='1']"/>
<xsl:apply-templates select="cell[@column='2']"/>
<xsl:apply-templates select="cell[@column='3']"/>
<xsl:apply-templates select="cell[@column='4']"/>
<xsl:apply-templates select="cell[@column='5']"/>
<xsl:apply-templates select="cell[@column='6']"/>
</xsl:copy>
</xsl:template>
<xsl:template match="cell[@column='1']">
<xsl:attribute name="column1">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="cell[@column='2']">
<xsl:attribute name="column2">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="cell[@column='3']">
<xsl:attribute name="column3">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="cell[@column='4']">
<xsl:attribute name="column4">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="cell[@column='5']">
<xsl:attribute name="column5">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="cell[@column='6']">
<xsl:attribute name="column6">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Applying template conditi, Xiaocun Xu | Thread | Find position among siblings {Re: [, Xiaocun Xu |
| Re: [xsl] URGENT help...XSL page ca, Larry_Mason | Date | Re: [xsl] xsl] XSL and XMLSchema wi, Francis Norton |
| Month |