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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:53:40+00:00 2026-05-22T11:53:40+00:00

Very next to XML, I’ve developed an XML sheet, alongside a XSD schema and

  • 0

Very next to XML, I’ve developed an XML sheet, alongside a XSD schema and finally a XSLT sheet to display the content. When I view the XML data sheet in a web browser (done in visual studio) it says the following:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

I’ve tried different filepaths and messed with the header, by not luck.

XML Data

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xslt" href="lecturelayout.xslt"?>
<university>
<lesson>
  <subject>Biology</subject>
  <maintopic name="Human Biology">
    <subtopic>Enlarge Hearts</subtopic>
    <subtopic>Heart Valves</subtopic>
  </maintopic>
  <content>
    <sentance>Very long sentance one</sentance>
    <sentance>Very long sentance two</sentance>
    <sentance>Very long sentance three</sentance>
  </content>
</lesson>

  <lesson>
    <subject>Chemistry</subject>
    <maintopic name="Periodic Table">
      <subtopic>Enlarge Hearts</subtopic>
      <subtopic>Heart Valves</subtopic>
    </maintopic>
    <content>
      <sentance>Very long sentance one</sentance>
      <sentance>Very long sentance two</sentance>
      <sentance>Very long sentance three</sentance>
    </content>
  </lesson>
</university>

XSLT Sheet – Note might not be 100% correct, obviously can’t test it:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="@* | node()">
      <html>
        <body>
          <h1>Professional Training Facilities</h1>
            <strong>University: </strong>
            <xsl:for-each select="university/lesson">          
            <xsl:value-of select="subject"/>
          <br/>
          <p>
            <strong>Main Topic: </strong>
            <xsl:value-of select="maintopic=name"/>
          </p>
          <br/>
          <p>
            <strong>Sub Topics: </strong>
            <xsl:for-each select="maintopic">
              <p>
                <xsl:value-of select="subtopic"/>
              </p>
            </xsl:for-each>
          </p>
          <p></p>
          <strong>Content:</strong>
          <xsl:for-each select="content">
            <p>
              <xsl:value-of select="sentance"/>
            </p>
          </xsl:for-each>
          </xsl:for-each> 
          <br/>
        </body>
      </html>
    </xsl:template>
</xsl:stylesheet>

Help greatly appreciated, spent a while research this but just can’t find any info on XSLT, unlike XSL.

EDIT: A mate just copied that on his machine(not that he programs) and gets the same result, could someone try it out please? 🙂

  • 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-22T11:53:40+00:00Added an answer on May 22, 2026 at 11:53 am

    In addition to adjusting the Processing Instruction @type to type="text/xsl", as suggested by @Matt Gibson, you need to adjust the match expression for your template.

    Your template is set to match on every attribute and node() and is producing multiple <html> elements(invalid).

    Adjust your template match to the root node:

    <xsl:template match="/">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so I have a very simple form with next to no logic in
Very often when working on an ASP.NET web site, the options View Code and
I've got some very large XML files which I read using a System.Xml.Serialization.XmlSerializer .
I am testing various methods to read (possibly large, with very frequent reads) XML
I have two XML sources to retrieve data from. I want to use them
I was going to use XML for communicating some data betwwen my server and
I'm trying to return an XML file based on my query results. I'm very
For the next week, I'm stuck with a sadly very slow 1-bar EDGE internet
I am finding often the need to very often wait until the next second
i have a problem with getting content from a XML into a mysql database.

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.