This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



<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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]