This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Applying template conditionally
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Applying template conditionally
- From: Xiaocun Xu <xiaocunxu at yahoo dot com>
- Date: Fri, 27 Apr 2001 09:20:59 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
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