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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:06:26+00:00 2026-06-06T04:06:26+00:00

I have a problem with generating an XML that needs to be generated automatically

  • 0

I have a problem with generating an XML that needs to be generated automatically and then manually uploaded on a client site for validation.

The specification of the client requires that we include the DTD declaration at the top.
That is

<!DOCTYPE TheFile System "TheDTD.dtd" ""> 

So programmatically when I try to generate the XML the line

    XmlDocumentType doctype;
    doctype = doc.CreateDocumentType("TheFile", null, "TheDTD.dtd", null);
    doc.AppendChild(doctype);

Fails and it asks me the “TheDTD.dtd” should exist in the windows directory:
C:\Windows\System32\inetsrv

Later if I want to read the XmlDoc the line

        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(xmlLocation);

Fails and it asks me the “TheDTD.dtd” should exist in the Project directory where the whole project is stored

I don’t want to actually validate the DTD, I just want to reference because the validation happens on the client side. Is there any way to add the line ” ” in the XML without having to copy the actual .dtd in 2 different locations?

If we make the declaration public and change this to

 <!DOCTYPE TheFile PUBLIC "TheDTD.dtd" ""> 

then everything works fine but the client requires that it should be SYSTEM and not PUBLIC.
I wish the CreateDocumentType and the Load method wouldn’t crash if the actual .dtd is missing because at this point I don’t even have this file and it’s not needed for my purposes.

Thank you

  • 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-06T04:06:27+00:00Added an answer on June 6, 2026 at 4:06 am

    You can set the XmlDocument.XmlResolver property to null. This disable the loading of external XML resources (dtd, schemas).

    doc.XmlResolver= null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am generating new xml file using perl script but I have small problem,
I have a JSON and XML based API that needs to be page cached.
I have a program that is generating Xml Files from data out of a
I have an xml schema (generated automatically using trang) which keeps changing. These changes
I have a problem with random number generating in C# I have tried all
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
I have a problem that I have not managed to solve. I developed a
I have a problem when generating java classes from WSDL using JAX-RPC wscompile ANT
Currently I have Javascript generating XML with an encoding set to UTF-8, and we've
The Situation I need to support generating XML documents based on schemas that vary

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.