I am parsing some manifest files and need to sanitize them before I can load them as XML. So, these files are invalid XML files.
Consider the following snippet:
<assemblyIdentity name=""Microsoft.Windows.Shell.DevicePairingFolder"" processorArchitecture=""amd64"" version=""5.1.0.0"" type="win32" />
There are several instances of double quotes, "", that I want to replace with single occurrences, ".
Essentially, the example would be transformed to
<assemblyIdentity name="Microsoft.Windows.Shell.DevicePairingFolder" processorArchitecture="amd64" version="5.1.0.0" type="win32" />
I presume a regex would be the best approach here, however, it is not my strong point.
The following should be noted:
- The manifest is a multiline string (essentially just an XML document)
- Something like
processorArchitecture=""is valid in the document hence why a simplestring.Replacecall is not appropriate.