By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,563 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

Question :Comparing 2 elements in xsl

P: n/a
Hello !!
I have this xml file :

<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="tables.xsl"?>
<aaa xmlns="http://tempuri.org/My.xsd">
<Dog>
<DogName>f1</DogName>
<Shot>16</Shot>
<DogDetail>
<DogName>f1</DogName>
<Vet>google</Vet>
<Degree>danny</Degree>
<Vaxin>false</Vaxin>
<DogText>amstaf kind of wolf</DogText>
<Side>1</Side>
</DogDetail>
<DogDetail>
<DogName>f1</DogName>
<Vet>wofy</Vet>
<Degree>pk</Degree>
<Vaxin>false</Vaxin>
<DogText>colly kind of buldog</DogText>
<Side>2</Side>
</DogDetail>
</Dog>
<Dog>
<DogName>test</DogName>
<Shot>16</Shot>
<DogDetail>
<DogName>test</DogName>
<Vet>google</Vet>
<Degree>danny</Degree>
<Vaxin>true</Vaxin>
<DogText>No Text</DogText>
<Side>1</Side>
</DogDetail>
<DogDetail>
<DogName>test</DogName>
<Vet>wofy</Vet>
<Degree>rexi</Degree>
<Vaxin>true</Vaxin>
<DogText>No Text</DogText>
<Side>2</Side>
</DogDetail>
</Dog>
<Dog>
<DogName>TWA</DogName>
<Shot>16</Shot>
<DogDetail>
<DogName>TWA</DogName>
<Vet>google</Vet>
<Degree>Wolfy</Degree>
<Vaxin>true</Vaxin>
<DogText>No Text</DogText>
<Side>1</Side>
</DogDetail>
<DogDetail>
<DogName>TWA</DogName>
<Vet>wofy</Vet>
<Degree>poki</Degree>
<Vaxin>true</Vaxin>
<DogText>No Text</DogText>
<Side>2</Side>
</DogDetail>
</Dog>
<Dog>
<DogName>QDA</DogName>
<Shot>16</Shot>
<DogDetail>
<DogName>QDA</DogName>
<Vet>yahoo</Vet>
<Degree>asmer</Degree>
<Vaxin>true</Vaxin>
<DogText>No Text</DogText>
<Side>1</Side>
</DogDetail>
<DogDetail>
<DogName>QDA</DogName>
<Vet>wofy</Vet>
<Degree>danny</Degree>
<Vaxin>true</Vaxin>
<DogText>No Text</DogText>
<Side>2</Side>
</DogDetail>
</Dog>
</aaa>

And i am trying to compare 2 elements (by the same name) from
different nodes , for example if we look on

<DogDetail>
<DogName>f1</DogName>
<Vet>google</Vet>
<Degree>danny</Degree>
<Vaxin>false</Vaxin>
<DogText>amstaf kind of wolf</DogText>
<Side>1</Side>
</DogDetail>
<DogDetail>
<DogName>f1</DogName>
<Vet>wofy</Vet>
<Degree>pk</Degree>
<Vaxin>false</Vaxin>
<DogText>colly kind of buldog</DogText>
<Side>2</Side>
</DogDetail>

I will compare "Vet" from the first "DogDetail" element (google) to
the second "Vet" in the second "DogDetail" element

( "wofy" in this case)

can you tell me how can i do it ?
is there anny "string compare" function in xsl ?
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.