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

Antw: How do match/compare nodes?

Subject: Antw: How do match/compare nodes?
From: agnes.kielen@xxxxxxx
Date: Fri, 16 Jan 2004 15:44:09 +0100
xsl compare nodes
Hi,
Do you mean something like:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/root">
     <xsl:if test="map[@id='0']/assignment/marker/name = map[@id='1']/assignment/marker/name">
        yes
     </xsl:if>
   </xsl:template>
</xsl:stylesheet>

Cheers,
Agnes


> 
> Van: vbarnard@xxxxxxxxxxxxx
> Aan: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Datum: vr 16 jan 04, 11:00
> Onderwerp:  How do match/compare nodes?
> 
> Hi
> 
> I am a bit confused how to tackle my problem and hope someone will be able
> to give me a few pointers how to get started at least.
> 
> I want to read in the xml file which contains two maps and if a particular
> node matches then I want to print out both maps in one line with elements
> separated by a pipe (|) symbol, if they don't match then I will ignore the
> result.
> 
> The node I want to match is "map/assignment/marker/name" 
> 
> 
> The is the relevant part of my xml code:
> 
> 	<map id="0">
> 		<name>Setaria-Wild-I</name>
> 		<species>Setaria italica</species>
> 		<lower_extent>21.7</lower_extent>
> 		<upper_extent>151.5</upper_extent>
> 		<assignment>
> 			<marker>
> 				<name>Xrgc285</name>
> 				<homology_group>C285</homology_group>
> 			</marker>
> 			<position>38</position>
> 		</assignment>
> 	</map>
> 	<map id="1">
> 		<name>Pennisetum-Lx1-7</name>
> 		<species>Pennisetum glaucum</species>
> 		<lower_extent>50</lower_extent>
> 		<upper_extent>151.5</upper_extent>
> 		<assignment>
> 			<marker>
> 				<name>Xrgc285</name>
> 				<homology_group>C285</homology_group>
> 			</marker>
> 			<position>24</position>
> 		</assignment>
> 	</map>
> 
> 
> 
> 
> Many thanks in advance,
> Virginia
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.