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

The Archive Base Latest Questions

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

I have XML data and am trying to use XSL to format the data.

  • 0

I have XML data and am trying to use XSL to format the data. I am following some tutorials. When previewing the XML in Internet Explorer the data is on one line; when previewing with Firefox I get the error message:

Error loading stylesheet: Parsing an XSLT stylesheet failed.

Here the XML:

 <?xml version= "1.0"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
    <countries>
        <country> 
            <countryname>United States</countryname>
        </country>

        <country>
            <countryname>United Kingdom</countryname>
        </country>

        <country>
            <countryname>Deutschland</countryname>
        </country>

        <country>
            <countryname>Osterreich</countryname>
        </country>

        <country>
            <countryname>Espana</countryname>
        </country>

        <country>
            <countryname>France</countryname>
        </country>

        <country>
            <countryname>Italia</countryname>
        </country>

        <country>
            <countryname>China</countryname>
        </country>

        <country>
            <countryname>Hong Kong</countryname>
        </country>

        <country>
            <countryname>Japan</countryname>
        </country>

        <country>
            <countryname>Singapore</countryname>
        </country>

        <country>
            <countryname>Taiwan</countryname>
        </country>

        <country>
            <countryname>Malaysia</countryname>
        </country>
    </countries>

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="/countries">
<html>
<body>

    <xsl:for-each select="country"

    <xsl:value-of select="countryname"/><br/>

    </xsl:for-each>

</body>
</html>


</xsl:template>

</xsl:stylsheet>

Why does the browser not display the XML document as described by the XSL template?

Thank you!

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

    Missing Bracket

    <xsl:for-each select="country" must be <xsl:for-each select="country">.

    Note the closing >.

    Extra Space

    Also, you may wish to remove the leading spaces on the first line of the document, if they exist:

     <?xml version="1.0" encoding="ISO-8859-1"?>
    

    vs

    <?xml version="1.0" encoding="ISO-8859-1"?>
    

    Typo

    </xsl:stylsheet> must be </xsl:stylesheet>

    After making these changes, the list of countries appear.

    Debugging

    Consider editing XML and XSL using a text editor that has syntax highlighting and would alert you visually to such errors.

    Syntax Highlighted Example

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

Sidebar

Related Questions

I have some XML data retrieved from a web service that I use to
I'm trying to use an xml file for spritesheet data; I have a frame
Trying to load some data off my server (xml data). I normally just use
I have an xml file(from federal government's data.gov) which I'm trying to read with
I'm trying to access list data using SSRS 2008. I have created an XML
I have a Sample Code where I'm trying to read data from an xml
I have some xml data contained in three files (Database.xml, Participants.xml, and ConditionTokens.xml). I
I have grabbed some XML data using this piece of jQuery: $.ajax({ type: POST,
I have to import some XML data into my app. Now I open a
I have two strings. One string is having XML Data and another string is

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.