Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8095063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:59:59+00:00 2026-06-05T20:59:59+00:00

consider my ‘destinationURLLookUp.xml’ file has the following structure <?xml version=1.0 encoding=UTF-8?> <destinationURLs xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance> <destinationURL

  • 0

consider my ‘destinationURLLookUp.xml’ file has the following structure

           <?xml version="1.0" encoding="UTF-8"?>
               <destinationURLs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
              <destinationURL name="Default Page" value="/abc/ab"/>
                     <destinationURL name="Home Page" value="/abc/ac"/>

                </destinationURLs>

I’m loading this file in my XSLT using the following XSLT code and have to retrieve the corresponding ‘name’ attribute for the ‘value’ that i’m processing for the

            <destinationURL> 

tag.

XSLT snippet that i have tried

        <xsl:variable name="prop" select="document('destinationURLLookUp.xml')"/>
                <xsl:variable name="rep2" select="$prop/destinationURLs/destinationURL[@value=@url]/@name"/>
                <xsl:value-of select="$rep2" />

where @url is the url value that i will get which matches the ‘value’ attibute of

               <destinationURL> 

tag. I’m unable to get the output.Can i get the relative xpath for accessing ‘name’ attribute for the corrsponding ‘value’ matched.

tried with $prop/destinationURLs/destinationURL[@value=@url]/@name
shown above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:00:02+00:00Added an answer on June 5, 2026 at 9:00 pm

    I think you are just missing to explicitly specify the template current contenxt for the @url attribute. The correct XPath depends by the template where your instruction is placed.

    I’m speaking about something like this:

    <xsl:variable name="rep2" 
     select="$prop/destinationURLs/destinationURL[@value=current()/@url]/@name"/>
    

    Do note current()/@url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following script for outputting some XML code: var xmlAsString = '<?xml version=1.0?><person><name
Consider having the following header file (c++): myclass.hpp #ifndef MYCLASSHPP_ #define MYCLASSHPP_ namespace A
Consider the following C#: // C# .net switch(x) { case 1: for(int i =
Consider the following URL: http://www.iamsomeweiredurl.fromsomewhere/andIwant#thisfragment Is there a chance to get thisfragment by @RequestMapping
Consider the following code: template <class x1, class x2 = int*> struct CoreTemplate {
Consider the following Mechanize form object #<Mechanize::Form {name f1} {method POST} {action f.php} {fields
Consider the following code: public interface A { public A another(); } public interface
Consider the following record: TMyRecord = record b: Boolean; // 3 bytes of padding
Consider the following snippet of code: foreach (var setting in RequiredSettings) { try {
Consider following make: all: a b a: echo a exit 1 b: echo b

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.