I am trying to serialize Xml to Bson. This means supporting all child classes of System.Xml.XmlNode. However, I cannot figure out now to implement an xml document that has an XmlEntity or an XmlNotation in it.
I tried parsing the html 4.0.1 strict dtd with XmlDocument.Load, but I got the following error:
System.Xml.XmlException : 'ENTITY' is an unexpected token. The expected token is 'DOCTYPE'. Line 78, position 3.
Is there another way to end up with an XmlDocument that will have XmlEntity and XmlNotation child nodes?
Problem, which Shellybutterfly began to point out with her suggestion to use SgmlReader, is that I was using a SGML dtd, not an xml dtd. I figured out the format of an xml dtd from w3schools.
I discovered you need to create an xml document, with a root element and declare the dtd in the DOCTYPE. to be able to load it with XmlDocument.Load(). For my test case I used:
I was able to use that in my tests project.