I'm trying to produce an XmlDocument
which has a DocType as specified in Apple's Property List (P-List) format, which should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
The code I have at the moment looks like this:
using (XmlTextWriter filenameXMLWriter = new XmlTextWriter(ms, null))
{
filenameXMLWriter.Formatting = Formatting.Indented;
filenameXMLWriter.WriteStartDocument();
filenameXMLWriter.WriteDocType("plist", "-//Apple//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null);
filenameXMLWriter.WriteStartElement("plist");
filenameXMLWriter.WriteAttributeString("version", "1.0");
..
..
}
The DocType
never gets written to the document (or at least it never appears in the output). I just get this:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
I'd be grateful for any help.