This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Transformation of generic spreadsheet XML
- To: Jeni Tennison <mail at jenitennison dot com>
- Subject: Re: [xsl] Transformation of generic spreadsheet XML
- From: Xiaocun Xu <xiaocunxu at yahoo dot com>
- Date: Thu, 19 Apr 2001 13:19:52 -0700 (PDT)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi, Jeni:
Very much appreciated for the well detailed answer
:)
> To answer your question, you can get the relevant
> cell by comparing its column
> attribute to the column attribute of the current
> cell, which you can get with:
>
> current()/@column
This is exactly what I needed.
> I think you'd be better off storing the bidHeader
> row in a global
> variable (assuming that the row elements are
> children of a 'rows'
> document element here):
>
> <xsl:variable name="bidHeader" select="/rows/row[1]"
> />
Sorry I did not provide the whole picture in my
original post (it was already pretty long :(). The
actual source XML had many rows before the $bidHeader
row, therefore the bid header row does not have exact
position among its siblings. So my XSL had to catch
that bid header row and process all following siblings
as follows:
<xsl:template match="row" mode="createBids">
<RFQRequest>
<xsl:element name="createBids">
<xsl:apply-templates
select="following-sibling::row" mode="BidsDetail"/>
</xsl:element>
</RFQRequest>
</xsl:template>
<xsl:template match="row" mode="BidsDetail">
<xsl:if test="string(cell[1]) = string('BidType') or
substring(cell[1],2) = string('BidType')">
<xsl:variable name="bidHeader" select="."/>
......
Thanks,
Xiaocun
__________________________________________________
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