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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:11:50+00:00 2026-06-13T13:11:50+00:00

Ok, I’m working through some simple tutorials from here: http://www.cch.kcl.ac.uk/legacy/teaching/7aavdh06/xslt/html/module_06.html The first exercise involves

  • 0

Ok, I’m working through some simple tutorials from here:

http://www.cch.kcl.ac.uk/legacy/teaching/7aavdh06/xslt/html/module_06.html

The first exercise involves creating a transformation that produces a certain output. Unfortunately, although I’m close, I get an unwanted element at the start. i.e.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  version="2.0">

  <xsl:output method="xhtml"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />

  <xsl:template match="/div/placeName">
    <html>
      <head />
      <body>
        <Table>
          <tr>
            <td>Place Name</td>
            <td>
              <xsl:value-of select="name" />
            </td>
          </tr>
          <tr>
            <td>Place Name (regularised)</td>
            <td>
              <xsl:value-of select="@reg" />
            </td>
          </tr>
          <tr>
            <td>National Grid Reference</td>
            <td>
              <xsl:value-of select="@key" />
            </td>
          </tr>
          <tr>
            <td>Type of building/monument</td>
            <td>
              <xsl:value-of select="settlement/@type" />
            </td>
          </tr>
        </Table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

but the output I’m getting is:

Location
Place Name  Old Warden
Place Name (regularised)    Old Warden, St Leonard
National Grid Reference TL 137 443
Type of building/monument   Parish church

The rest is fine but the ‘Location’ is unwanted. The source XML is at the link above. Any idea how I stop the unwanted text appearing? Or, better still, tell me where I’m going wrong! 🙂

Edit: Here is the output

<?xml version="1.0" encoding="utf-8" ?>
Location
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
    <table>
        <tr>
            <td>Place Name</td>
            <td>Old Warden</td>
        </tr>
        <tr>
            <td>Place Name (regularised)</td>
            <td>Old Warden,  St Leonard</td>
        </tr>
        <tr>
            <td>National Grid Reference</td>
            <td>TL 137 443</td>
        </tr>
        <tr>
            <td>Type of building/monument</td>
            <td>Parish church</td>
        </tr>
    </table>
</body>
</html>
  • 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-13T13:11:51+00:00Added an answer on June 13, 2026 at 1:11 pm
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xhtml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
    <xsl:template match="div">
    <xsl:apply-templates select="placeName"/>
    </xsl:template>
      <xsl:template match="placeName">
        <html>
          <head />
          <body>
            <Table>
              <tr>
                <td>Place Name</td>
                <td>
                  <xsl:value-of select="name" />
                </td>
              </tr>
              <tr>
                <td>Place Name (regularised)</td>
                <td>
                  <xsl:value-of select="@reg" />
                </td>
              </tr>
              <tr>
                <td>National Grid Reference</td>
                <td>
                  <xsl:value-of select="@key" />
                </td>
              </tr>
              <tr>
                <td>Type of building/monument</td>
                <td>
                  <xsl:value-of select="settlement/@type" />
                </td>
              </tr>
            </Table>
          </body>
        </html>
      </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

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.