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 8971505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:58:26+00:00 2026-06-15T17:58:26+00:00

I am a beginner at using XSL and XML. I have a problem with

  • 0

I am a beginner at using XSL and XML. I have a problem with fetching the data from the XML document and using it in the XSL. Currently I am trying different methods but can’t seem to get it right and I will need to use this technique throughout to complete the project. Once I can do it to one I will be able to do throughout the page.

Here is samples from my XML and my XSL document:

<storelocator> 
    <!--Parent element containing all text on the page-->
    <content_text> 
        <title>
            <titlename>Store Locator</titlename> 
        </title>
        <title>
            <subtitle>FIND A STORE</subtitle>
        </title>
        <title>
            <countrydropdown>Country</countrydropdown>
        </title>
        <title>
            <address>Steet Address, City, Sate/Province OR Postal/Zip Code</address>
        </title>
        <title>
            <radiusdropdown>Radius</radiusdropdown>
        </title>
        <title>
            <featuredstore>FEATURED STORE</featuredstore>
        </title>
        <title>
            <storelocation>Newbury Street, Boston, MA USA</storelocation>
        </title>
</storelocator>

Here is the XSL:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body bgcolor="white">

<div id="container" style="100%">

<div id="header" style="background: url('header.png'); height:30px;"></div>

<div id="content_container" align="center" style="text-transform: uppercase; font-family: tahoma; font-weight: normal; font-size: 0.8em">
    <div id="content" align="left" style="background-color:blue;height:845px;width:848px">

   <xsl:value-of select="titlename"/> <!--here I was trying to import the text from XML DOC-->

<br/>
<br/>
<br/>
    <img src="image.png" align="left"/><br/>
<br/>
<br/>
<br/>
<br/>

</div>
</div>

<div id="footer" style="background-color:black;clear:both;text-align:center;height:20px"></div>
</div>
</body>
</html>

</xsl:template>
</xsl:stylesheet>

Basically what I am trying to do is import the “store locator” title so that it displays above the image but currently nothing appears when it is opened in browser. I would much appreciate some help as I have been trying to do it for a while.

  • 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-15T17:58:28+00:00Added an answer on June 15, 2026 at 5:58 pm

    One of the most important things to remember in XSLT is that all paths are going to be based on context. In your example, the context is / because in your template, you’re matching /. You can’t go straight from / to titlename.

    Try changing your xsl:value-of to:

    <xsl:value-of select="storelocator/content_text/title/titlename"/>
    

    Also, the XSLT isn’t “importing” your XML; it’s transforming it. If you’re just opening the XSLT in the browser, this isn’t going to work. To get the transform to work in a browser when opening the XML, you’ll have to add a processing instruction that points to your XSLT:

    <?xml-stylesheet type="text/xsl" href="test.xsl"?>
    <storelocator> 
    ...
    </storelocator>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginner at XSL FO. I have a very simple XML document :
I am a beginner in using LINQ. I have an xml data with the
RoR beginner here using rails 3.2.3 and ruby 1.9.3 Currently I am trying to
I am a beginner at C++ but I have some experience using Java. I
I'm a RoR beginner and am using Rails 3.2.3. I have a search form
I'm a Python beginner and have just started using packages. When you're calling a
I am a beginner to php and mySQL and I am currently using dreamweaver
I am an XML beginner. I am using lxml python libs to process a
I have a xml document on the following format and want to transform it
I have next xml: <page> <document> <id>1001</id> <cur>USD</cur> <date>01.01.2009</date> <amount>10</amount> </document> <document> <id>1001</id> <cur>USD</cur>

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.