Description
I dont know if the parser supports extracting Entity
and EntityReference
but they are not in my case.
Below is the XML (reference https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlreader.read?view=netcore-3.1#examples)
<?xml version="1.0"?>
<!-- This is a sample XML document -->
<!DOCTYPE Items [
<!ENTITY num "123">
]>
<Items ok="yes" okay="okay">
<Item>Test with an entity: #</Item>
<Item>Test with a child element <more /> stuff</Item>
<Item>Test with a CDATA section <![CDATA[<456>]]> def</Item>
<Item>Test with a char entity: A</Item>
<!-- Fourteen chars in this element.-->
<Item>1234567890ABCD</Item>
</Items>
I dont get Entity node from the parser.
If you see the example code there for DocumentType
it parses Entity in the above example as is , but DomParser
isnt parsing it.
case XmlNodeType.DocumentType:
Console.Write("<!DOCTYPE {0} [{1}]", reader.Name, reader.Value); //reader.value is not fetched by DomParser
break;
Also why significant whitespace with next line are parsed as Text codes? They probably dont qualify to be termed as Text even though its similar but, I think they may have to be emitted as WhiteSpace or Significant whitespace Nodes.
See the C# NodeType enum which does include SignficantWhiteSpace
here https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlnodetype?view=netcore-3.1
Other Example of DTD : https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlreadersettings.dtdprocessing?view=netcore-3.1#input