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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:14:51+00:00 2026-05-24T07:14:51+00:00

I’m trying to clean some htmls. I have converted them to xhtml with tidy

  • 0

I’m trying to clean some htmls. I have converted them to xhtml with tidy

$ tidy -asxml -i -w 150 -o o.xml index.html

The resulting xhtml ends up having named entities.
When trying xsltproc on those xhtmls, I keep getting errors.

$ xsltproc --novalid  -o out.htm  t.xsl o.xml
o.xml:873: parser error : Entity 'mdash' not defined
            resources to storing data and using permissions &mdash; as needed.</
                                                                   ^
o.xml:914: parser error : Entity 'uarr' not defined
        </div><a href="index.html#top" style="float:right">&uarr; Go to top</a>
                                                                 ^
o.xml:924: parser error : Entity 'nbsp' not defined
          Android 3.2&nbsp;r1 - 27 Jul 2011 12:18

If I add –html to the xsltproc it complains on a tag that has name and id attributes with same name (which is valid)

$ xsltproc --novalid --html -o out.htm  t.xsl o.xml o.xml:845: element a: validity error : ID top already defined
      <a name="top" id="top"></a>
                            ^

The xslt is simple:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>

    <xsl:template match="node()|@*">
      <xsl:copy>
         <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
    </xsl:template>

    <xsl:template match="//*[@id=side-nav]"/>
</xsl:stylesheet>

Why doesn’t –html work? Why is it complaining? Or should I forget it and fix the entities?

  • 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-24T07:14:52+00:00Added an answer on May 24, 2026 at 7:14 am

    I am assuming that the unclearly stated question is this: I know how to avoid “Entity ‘XXX’ not defined” errors when running xsltproc (add --html). But how do I get rid of “ID YYY already defined”?

    Recent builds of Tidy have an anchor-as-name option. You can set it to “no” to remove unwanted name attributes:

    This option controls the deletion or addition of the name attribute in elements where it can serve as anchor. If set to “yes”, a name attribute, if not already existing, is added along an existing id attribute if the DTD allows it. If set to “no”, any existing name attribute is removed if an id attribute exists or has been added.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have some data like this: 1 2 3 4 5 9 2 6

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.