[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|