Re: can you nest xsl:if with in xsl:choose/when?

Subject: Re: can you nest xsl:if with in xsl:choose/when?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 4 Apr 2000 14:20:47 +0100 (BST)
<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


Current Thread