[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem with xsl:if

Subject: Re: Problem with xsl:if
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 21 Apr 2004 17:17:02 +0100
Re:  Problem with xsl:if
<xsl:template match="*[@attr-name='jkuPeHabd']">

This will match your

         <add-attr attr-name="jkuPeHabd">
            <value type="string">7777-33-11</value>
         </add-attr>

but then you do

<xsl:variable name="slart"
select="//*[@attr-name='jkuPeBeschSAP22SLART']//value"/>

which ignores the element you are on. and searches the entire document
for an element with attr-name='jkuPeBeschSAP22SLART' I suspect that you
don't want to search the entire document, just the siblings of that the
add-attr that you are on? and in the example you posted there are no
attributes with values 'jkuPeBeschSAP22SLART' so this vriable will be an
empty node set and test will be false (beware using != with node set
valuedvariables by the way, the test is always true unless the set is
non empty and all values are equal)

I suspect that you want your identity template plus

	<xsl:template match="*[@attr-name='jkuPeHabd']
       [not(../*[@attr-name='jkuSLABS']/value=90 and ../*[@attr-name='jkuSLART]/value=50)]"/>

which will stop the 'jkuPeHabd' elements being copied unless their
siblings have the specified values.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.