Solved

XSL: obtain attribute value when another attribute value is matching

Posted on 2013-11-21
3
184 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
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 rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

820 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