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

  • SEARCH
  • Home
  • 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 6698825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:37:25+00:00 2026-05-26T06:37:25+00:00

I’m getting a following response from the back-end servers to display the data as

  • 0

I’m getting a following response from the back-end servers to display the data as quick links on the right side of the search results page.

 <NavigatorItems>
  <Navigator Name="Shoes">
   <Name>Nike</Name>
   <WebSite>www.nike.com</WebSite>
   <Name>Reebok</Name>
   <WebSite>www.reebok.com</WebSite>
   <Name>Adidas</Name>
   <WebSite>www.adidas.com</WebSite>
   <ShowAll>www.mysite.com/showallshoes</ShowAll>
  </Navigator>
  <Navigator Name="Clothes">
   <Name>Lee Jeans</Name>
   <WebSite>www.lee.com</WebSite>
   <Name>Levis</Name>
   <WebSite>www.levi.com</WebSite>
   <Name>Lawman</Name>
   <WebSite>www.lawman.com</WebSite>
   <ShowAll>www.mysite.com/showallclothes</ShowAll>
  </Navigator>
 </NavigatorItems>

I need to display these items using XSLT something like this:

enter image description here

The sample XSLT suggested by someone is something like this:

 <xsl:for-each select="NavigatorItems/Navigator">
   <xsl:variable name="link" select="WebSite"/>
   <tr>
     <td><a href ="{$link}"><xsl:value-of select="Name"/></td>
   </tr>
   <xsl:test select="ShowAll"> 
     <xsl:variable name="linkShowAll" select="ShowAll"/>
      <tr> <td> <a href="{$linkShowAll}"> View More Results <td> </tr>
   </xsl:test>
 </xsl:for-each>

But it displays only

 Nike (with its appropriate link)

 Lee (with its appropriate link)

Where I’m going wrong with this ? I tried a lot to modify the XSLT and checked but no luck.

Please suggest.

  • 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-05-26T06:37:25+00:00Added an answer on May 26, 2026 at 6:37 am

    This transformation:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
     
     <xsl:template match="Navigator">
      <p><xsl:value-of select="@Name"/></p>
      <ul>
       <xsl:apply-templates select="Name"/>
      </ul>
      <xsl:apply-templates select="ShowAll"/>
     </xsl:template>
     
     <xsl:template match="Name">
      <li>
       <a href="http://{following-sibling::WebSite[1]}">
         <xsl:value-of select="."/>
       </a>
      </li>
     </xsl:template>
     
     <xsl:template match="ShowAll">
      <p>
        <a href="http://{.}">
         <xsl:text>View More Results</xsl:text>
        </a>
      </p>
     </xsl:template>
    </xsl:stylesheet>
    

    when applied to the provided XML document:

     <NavigatorItems>
      <Navigator Name="Shoes">
       <Name>Nike</Name>
       <WebSite>www.nike.com</WebSite>
       <Name>Reebok</Name>
       <WebSite>www.reebok.com</WebSite>
       <Name>Adidas</Name>
       <WebSite>www.adidas.com</WebSite>
       <ShowAll>www.mysite.com/showallshoes</ShowAll>
      </Navigator>
      <Navigator Name="Clothes">
       <Name>Lee Jeans</Name>
       <WebSite>www.lee.com</WebSite>
       <Name>Levis</Name>
       <WebSite>www.levi.com</WebSite>
       <Name>Lawman</Name>
       <WebSite>www.lawman.com</WebSite>
       <ShowAll>www.mysite.com/showallclothes</ShowAll>
      </Navigator>
     </NavigatorItems>
    

    produces the wanted, correct result:

    <p>Shoes</p>
    <ul>
       <li>
          <a href="http://www.nike.com">Nike</a>
       </li>
       <li>
          <a href="http://www.reebok.com">Reebok</a>
       </li>
       <li>
          <a href="http://www.adidas.com">Adidas</a>
       </li>
    </ul>
    <p>
       <a href="http://www.mysite.com/showallshoes">View More Results</a>
    </p>
    <p>Clothes</p>
    <ul>
       <li>
          <a href="http://www.lee.com">Lee Jeans</a>
       </li>
       <li>
          <a href="http://www.levi.com">Levis</a>
       </li>
       <li>
          <a href="http://www.lawman.com">Lawman</a>
       </li>
    </ul>
    <p>
       <a href="http://www.mysite.com/showallclothes">View More Results</a>
    </p>
    

    and the browser displays it like this:

    Shoes

    • Nike
    • Reebok
    • Adidas

    View More Results

    Clothes

    • Lee Jeans
    • Levis
    • Lawman

    View More Results

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

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.