[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Transformation of generic spreadsheet XML
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|