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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:48:11+00:00 2026-06-11T20:48:11+00:00

I recently created a small C# windows forms/LINQ to XML app in VS2010 that

  • 0

I recently created a small C# windows forms/LINQ to XML app in VS2010 that does exactly what it’s supposed to do, except for one thing: it adds “[]” to the end of the DOCTYPE tag, which apparently is causing files to be rejected from a legacy system. Here’s a before and after:

Before

<!DOCTYPE ichicsr SYSTEM "http://www.accessdata.fda.gov/xml/icsr-xml-v2.1.dtd">

After

<!DOCTYPE ichicsr SYSTEM "http://www.accessdata.fda.gov/xml/icsr-xml-v2.1.dtd"[]>

These characters get added after the file is saved within the program using the .Save function. The program allows selection of an .xml file, then “cleans” it by removing certain tags, then saves it. When the process begins, the files do not have the “[]” in the DOCTYPE. After saving, they do. Does LINQ to XML add these?

Is there any way to keep the program from adding these characters?

  • 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-11T20:48:13+00:00Added an answer on June 11, 2026 at 8:48 pm

    Evidently, when XDocument parses an XML document that contains a Document Type Declaration, an empty “internal subset” is automatically inserted if one doesn’t exist. (The internal subset is the part surrounded by [] in the <!DOCTYPE>).

    The result is well-formed XML. However, if your legacy system can’t handle it, you can remove the internal subset from the DTD by setting the XDocumentType.InternalSubset property to null:

    XDocument document = ...;
    if (document.DocumentType != null)
        document.DocumentType.InternalSubset = null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently inherited maintenance of a relatively small iOS application. The app was created
I recently created a new header file that I want to include in the
I recently created a advanced form with elements that use jquery's $().hide & $().show
I recently created a generic Matrix<T> class that acts as a wrapper around a
I recently created a function in javascript that takes in a file name and
I recently created a WCF service that works fine when tested from Visual Studio
I've created a small GUI to manipulate data and recently I decided to move
Recently I created an application (sales portal) in PHP for a small company. The
I have recently joined a small development team that is considering a new version
I recently upgraded one of my applications to Rails 2.2.2. Having done that, I've

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.