Link to home
Create AccountLog in
Avatar of tesmc
tesmcFlag for United States of America

asked on

XSL - loop and if attribute contains text then store that

I have the following xml input
<Envelope>
      <Body>
            <Travel>
            <Itinerary>
                  <Ticket Limit="T-05SEP" />
                  <Ticket Number ="TS 12345 SMITH/JOHN" />
                  <Ticket Number ="TK 66777 SMITH/JOHN" />
                  </Itinerary>
            </Travel>      
      </Body>
</Envelope>

I want to loop through each Ticket node and if the @Number contains "TK" then return that value and place it in  <xsl:attribute name="DocNum"> inside <References>

So output should be:
<References @DocNum="66777">
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of tesmc

ASKER

thank you.