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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:25:39+00:00 2026-05-11T13:25:39+00:00

In a previous question I mentioned some work with a 3rd party DLL whose

  • 0

In a previous question I mentioned some work with a 3rd party DLL whose interface uses a series of XML inputs that are defined using DTDs. Everything has gone smoothly so far, but I still have this nagging issue with resolving the Document Type Declaration in the generated input values.

What I can’t figure out is what the deciding factor is in determining where to look for the referenced DTD file. If I have a declaration that looks like this:

<!DOCTYPE ElementName SYSTEM 'ElementName.dtd'> 

My initial thinking was that the application’s current execution path is where a parser would look for the DTD. However, when I attempt to use an XML control in ASP.Net, the error I get baffles me…

Could not find file ‘c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ElementName.dtd’

Why is it looking for the DTD there?

Are there any XML gurus out there who can help me out on this one. I really don’t have any control over the XML that is returned from this DLL so what am I supposed to do. Is there a way to ‘register’ a DTD with the operating system? Like the GAC?

  • 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. 2026-05-11T13:25:39+00:00Added an answer on May 11, 2026 at 1:25 pm

    Unfortunately the library that generated the XML used a relative url for the dtd rather than a fully qualified one. As such the XmlControl’s XmlDocument is using an XmlResolver class to convert the relative path to a fully qualified one. By default it uses an XmlUrlResolver (that is a concrete XmlResolver). This will try to map the location of the dtd to a location it thinks is relative to the Xml document. Trouble is, where is the XmlDocument? Probably in memory which is not relative to anything and the XmlUrlResolver is using the process location instead which in your case is Visual Studio which is located at ‘c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe’.

    So what can you do? Well I suppose you have to crate you own XmlResolver that inherits from XmlUrlResolver an overrides the ResolveUri method and does something appropriate. Having done that you will have to:

    1. Create an XmlReaderSettings class and set the XmlReolver property to the class you just created.
    2. Create an XmlReader using XmlReader.Create() passing in your document and the XmlSettings object.
    3. Create an XmlDocument and call Load passing in the XmlReader and finally.
    4. Set the XmlDocument property of your XmlControl to the XmlDocument.

    Frankly that is all a bit of a pain, so if it where me I would just use string.Replace to remove the DTD declaration from the document before processing it into XML.

    If you are feeling really brave you can create a resolver that inherits directly from XmlResolver. Once you have done that you can override the GetEntity method and then you can get the dtd document from wherever you like. I wrote one once that got dtds from files embedded as resource files, but unfortunately, I don’t have the code any more 🙁

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

Sidebar

Ask A Question

Stats

  • Questions 95k
  • Answers 95k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Wrap the div inside another div. Add the padding/margin to… May 11, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer The main problem is that scriptaculous doesn't have stop(): you… May 11, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer Try any of these javascript libraries: http://www.dojotoolkit.org/ http://mootools.net/ http://jquery.com/ http://script.aculo.us/… May 11, 2026 at 7:03 pm

Related Questions

I have a method that contains an asynchronous call like this: public void MyMethod()
This is similar to a previous question , but the answers there don't satisfy
I am taking over some applications from a previous developer. When I run the
I'm writing a DSL in Ruby to control an Arduino project I'm working on;

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.