[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Applying template conditionally
Hi, Now the problem I am trying to solve just became more complicated. :( The source XML document will now have 3 distinctive sections: the first section is RFQ contains one header and one detail rows; the second section is Extended Attribute Definition contains one header and multiple detail rows; and the third section is LineItems contains one header and multiple detail rows. For each of the 3 distinctive sections, I need to apply a different template. The two ways I was thinking of using are: 1. find the position() of the header rows, and apply the appropriate templates only to the rows with position inbetween the headers. The question I have is how can I find the position() of the header rows? The query I use to find the header row is: <xsl:variable name="RFQHeader" select="book/sheet/range/row[cell[1] = 'OrganizationCode' or substring(cell[1], 2) = 'OrganizationCode']"/> 2. a domino approach. Each time upon finding the header row, apply the appropriate template to following-siblings. The problem I see is how can I stop applying one template when I found the next header row? Is this way feasible at all? Any other suggestions to handle this problem more effeciently? Much appreciated for any suggestions and comments. 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
|