Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-16
3
Medium Priority
?
568 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
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

916 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