This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: can you nest xsl:if with in xsl:choose/when?
- To: xsl-list at mulberrytech dot com
- Subject: Re: can you nest xsl:if with in xsl:choose/when?
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Tue, 4 Apr 2000 14:20:47 +0100 (BST)
- References: <BB3B8E2BD7EED211935500A0C9C74B7B86EDCD@exch-grimm.btg.com>
- Reply-To: xsl-list at mulberrytech dot com
<xsl:template match="text">
<xsl:choose>
<xsl:when test="contains(//image/@attribute,'value')">
<xsl:if test="contains(@attribute1,'value1')">
THIS
this says that for each text element
if the first image in the document (not necessarily under the text
element) has an attribute 'attribute' containing 'value'
then if this text element has an 'attribute1' attribute with value
containing 'value1' do THIS
is that what you wanted?
//image/@attribute, seems particularly strange thing to test for, and
expensive unless the system optimises it away. You are asking, on each
text element, to search the entire document for every image element with
an attribute attribute, then because you use that node set in a string
context, every node except the first is discarded, and you take the
string value of the first attribute in the document, and then you do
the same calculation, and get the same result again on each text element.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list