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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:46:57+00:00 2026-05-27T16:46:57+00:00

Hey I try to validate my html page with official dtd : MemoryStream ms

  • 0

Hey I try to validate my html page with official dtd :

MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(MessageBody));
ms.Position = 0;
XmlReaderSettings settingsReader = new XmlReaderSettings();
settingsReader.DtdProcessing = DtdProcessing.Parse;
settingsReader.ValidationType = ValidationType.DTD;
MyUrlResolver resolver = new MyUrlResolver();
settingsReader.XmlResolver = resolver;
 XmlReader reader = XmlReader.Create(ms, settingsReader);
 while(reader.Read()){}

and custom XmlUrlResolver:

class MyUrlResolver : System.Xml.XmlUrlResolver
{
    public MyUrlResolver()
    { }

    public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
    {
        if (File.Exists(System.Web.Hosting.HostingEnvironment.MapPath("~/dtd/xhtml11.dtd")))
        {
            absoluteUri = new Uri(System.Web.Hosting.HostingEnvironment.MapPath("~/dtd/xhtml11.dtd"));
        }
        return base.GetEntity(absoluteUri, role, ofObjectToReturn);
    }

    public override Uri ResolveUri(Uri baseUri, string relativeUri)
    {
        baseUri = new Uri(System.Web.Hosting.HostingEnvironment.MapPath("~"));
        relativeUri = "dtd/xhtml11.dtd";
        return base.ResolveUri(baseUri, relativeUri);
    }
}

Durning reading xml occurs validation and I get exception:

Parameter entity ‘xhtml-inlstyle.mod’ references itself. Line 111, position 21.

Error occurs here :

   <!-- Inline Style Module  ........................................ -->
<!ENTITY % xhtml-inlstyle.module "INCLUDE" >
<![%xhtml-inlstyle.module;[
<!ENTITY % xhtml-inlstyle.mod
     PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
            "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod" >
%xhtml-inlstyle.mod;]]>

I cannot understand why official dtd is wrong :/ What should I do ?

  • 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-27T16:46:57+00:00Added an answer on May 27, 2026 at 4:46 pm

    Solution for me was download xhtml11.dtd and all *.mod files referenced to dtd. Then I in dtd remove http links to

        <!ENTITY % xhtml-datatypes.module "INCLUDE" >
    <![%xhtml-datatypes.module;[
    <!ENTITY % xhtml-datatypes.mod
         PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
                "xhtml-datatypes-1.mod" >
    %xhtml-datatypes.mod;]]>
    

    Now dtd during validation html page can use local dtd without download it from www 😉

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

Sidebar

Related Questions

Hey everyone, I'm basically new to programming. I've decided to try and get started
Hey I try to write a littel bash script. This should copy a dir
Hey when I try to save a object to internal storage. I keep on
hey my problem is when i try to update my database it goes through
Hey, I want to use Devise and acts_as_audited together but when I try and
hey all, I'm new to Java and was wondering if I define a method
Hey, i try to trim each string item of an list in groovy list.each()
Hey guys! When I try to do the following in a header file static
Hey all of you at Stackoverflow. I got this incredibly annoying problem. I try
Hey, new to Django and needing assistance, when I add my model to the

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.