Solved

XSL: obtain attribute value when another attribute value is matching

Posted on 2013-11-21
3
182 Views
Last Modified: 2013-11-21
I have the following 3 items stored in a variable $viewServRef:

<ServRef Key="333" Doc="1076">
<ServRef Key="336" Doc="1079">
<ServRef Key="339" Doc="1082">

how do i then proceed to grab the one instance of Key where Doc is found
I was trying to do something like below. but that returned nothing.
<xsl:variable name="Key"    select= "$viewServRef/@Key[@Doc=$Tkt]" />

such that $Key = 333 bc $Tkt =1076
0
Comment
Question by:badtz7229
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 39666555
<xsl:variable name="Key"    select= "$viewServRef[@Doc=$Tkt]/@Key" />
0
 

Author Closing Comment

by:badtz7229
ID: 39666782
thank u
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39666951
welcome
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question