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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:13:27+00:00 2026-06-04T17:13:27+00:00

When I try to read an XML document (eagle file) with an DTD I

  • 0

When I try to read an XML document (eagle file) with an DTD I get the error:

Project xx raised exception class EDOMParserError with message ‘DTD is
prohibited’

The XML header looks like this:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">

If I remove the second line…

<!DOCTYPE eagle SYSTEM "eagle.dtd">

…everything works fine.

After some googling it seems like the MSXML parser have an option called ´prohibitDTD´ set to true by default (in earlier versions it was false).

However it seems not possible to set this option to false from the TXMLDocument class. One solution seems to be a recompile of the .pas library or to create the interface on my own with CoCreateInstance().

All examples I have seen out there are in Delphi and I’m having dificulties to trasnlate these to C++ Builder.

Does anyone know how to read a DTD XML document with C++ Builder XE2?

My example code…

#include <xmldoc.hpp>

_di_IXMLNode XMLObject;

TXMLDocument *XMLDocument = new TXMLDocument(this);
XMLDocument->LoadFromFile(fileName); // <----- Exception EDOMParserError
XMLObject = XMLDocument->DocumentElement;

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-04T17:13:28+00:00Added an answer on June 4, 2026 at 5:13 pm

    XE2 introduced a native solution to this very problem: there is a global bool variable named MSXML6_ProhibitDTD declared in Xml.Win.msxmldom.hpp. You can set it to false before loading data into TXMLDocument:

    #include <xmldoc.hpp>
    #include <msxmldom.hpp>
    
    MSXML6_ProhibitDTD = false;
    TXMLDocument *XMLDocument = new TXMLDocument(this):
    XMLDocument->LoadFromFile(fileName);
    _di_IXMLNode XMLObject = XMLDocument->DocumentElement;
    

    On a side note: it is generally not a good idea to create TXMLDocument instances dynamically like this. It is better to use the IXMLDocument interface instead:

    #include <xmldoc.hpp>
    #include <msxmldom.hpp>
    
    MSXML6_ProhibitDTD = false;
    _di_IXMLDocument XMLDocument = LoadXMLDocument(fileName);
    _di_IXMLNode XMLObject = XMLDocument->DocumentElement;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is easy to read an XML file and get the exact Node Text,
I try to read file /proc/'pid'/status, using c program. The code is as follows,
When I try to read bash history into vim, I get nothing. :r !history
I get a warning in MSVC++ when I try to read an integer from
I am trying to read a XML document with C#, I am doing it
I'm trying to read an XML document which contains &#x2122; (™), but for some
I have a little app that is supposed to read through an XML document
I need to write XML data to an encrypted file. I can read/write encrypted
I'm trying to read a Collada XML file by iterating through a child node
I have an xml file XMLParsing.java read all the file XML My goal is

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.