Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

When I load an XmlDocument, it adds [] characters after the "Profile.dtd"

Posted on 2011-09-16
3
Medium Priority
?
560 Views
Last Modified: 2012-05-12
Hello,

I have a VB app that uses XML.  When I load an XmlDocument from an actual XML file, [] characters are added right after the "Profile.dtd" in the second line of the XmlDocument's OuterText.

So that:
<!DOCTYPE Profile_Instance SYSTEM "Profile.dtd">     becomes...
<!DOCTYPE Profile_Instance SYSTEM "Profile.dtd"[]>

And this is the way the resulting file is written out.  This then messes things up.

Is there any way to keep the [] charcters from being added in?

Thanks in advance,
Tim
0
Comment
Question by:tmitch68
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 36550833
This is a normal, optional part of a doctype declaration: http://en.wikipedia.org/wiki/Document_Type_Declaration.

It is probably being added automatically as a "just-in-case" type thing. I don't think it is really avoidable, but you can programatically remove them if you need.
0
 

Author Comment

by:tmitch68
ID: 36551011
Thanks - I've tried a few things to remove them programmatically.

So far, none of these have worked.  If I try to replace the OuterText of the node, this doesn't work because OuterText is read-only.
If I try to replace the node altogether, this doesn't work because I can't create a node with a ! character.

Do you possibly know of any other programmatic possibilities?

Thanks,
Tim
0
 
LVL 28

Accepted Solution

by:
strickdd earned 2000 total points
ID: 36551043
The best I can think of off the top of my head is to convert the document to a string and perform a replace on it.
0

Featured Post

Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question