Question :Comparing 2 elements in xsl

Discussion in 'XML' started by Ex-Em-El, Aug 5, 2004.

  1. Ex-Em-El

    Ex-Em-El Guest

    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 ?
     
    Ex-Em-El, Aug 5, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. farah
    Replies:
    22
    Views:
    1,725
    Remon van Vliet
    Apr 3, 2006
  2. Replies:
    1
    Views:
    3,637
    A. Bolmarcich
    May 27, 2005
  3. Rob Smegma
    Replies:
    1
    Views:
    1,826
    shaun
    Sep 26, 2005
  4. Varun Sinha

    Comparing elements of an array to a char

    Varun Sinha, Nov 24, 2003, in forum: C Programming
    Replies:
    9
    Views:
    427
    Irrwahn Grausewitz
    Nov 25, 2003
  5. Red
    Replies:
    2
    Views:
    1,226
    Pavel Lepin
    May 9, 2007
Loading...

Share This Page