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 XSLT script: <?xml version=1.0 encoding=ISO-8859-1?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output method=text encoding=iso-8859-1/>
Consider the following script for outputting some XML code: var xmlAsString = '<?xml version=1.0?><person><name
Consider a directory structure containing the following files: \1.3\Baseline\GeneratedScripts\One\FullInstall.cmd \1.3\Baseline\GeneratedScripts\Two\FullInstall.cmd \1.3\Baseline\GeneratedScripts\Three\FullInstall.cmd \1.3\Patches\Patch1\GeneratedScripts\One\FullInstall.cmd \1.3\Patches\Patch1\GeneratedScripts\Two\FullInstall.cmd \1.3\Patches\Patch1\GeneratedScripts\Three\FullInstall.cmd
Consider the following class: public class Score { private static readonly Guid _relationId =
Consider the following (simplified) situation: class Foo { private: int evenA; int evenB; int
Consider the following program which inserts a range of elements into a vector: vector<string>
Consider the following snippet. qIn is a BlockingQueue , LinkedBlockingQueue implementation while (true) {
Consider the following code: char* p = new char[2]; long* pi = (long*) p;
Consider the following situation: public class Storage { public T GetSingleByID<T>(long id) where T
Consider a nonlinear least squares model in R, for example of the following form):

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.