Replace a word in an XML file through StreamReader in XNA?

Posted by kcoppock on Stack Overflow See other posts from Stack Overflow or by kcoppock
Published on 2010-05-24T23:28:12Z Indexed on 2010/05/24 23:31 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
|

Okay, so this is sort of a hack...but it may have to be. I'm writing an app in XNA, which from my research into this problem apparently doesn't support XML version 1.1. I'm reading in the contents of an ePub document, and one of the newer books contains its content directory as a version 1.1 XML document. This causes my program to crash. However, the structure is the same as the rest, the only thing that should be keeping it from working is the hard-coded "1.0" in the XmlDocument class.

Is it possible that I could read in the file from the stream, see if it contains:

<?xml version="1.1" encoding="UTF-8" standalone="no"?>

and simply replace it with "1.0"? Then I could pull it in as an XmlDocument. I'm not doing any writing to the file, or any complex structural reading, just looking for a few specific nodes, and pulling in the values, so I don't know what the ramifications of this would be.

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml