8000 To what degree should xmldom support DTD processing support for Entity/ EntityReference? · Issue #117 · xmldom/xmldom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
To what degree should xmldom support DTD processing support for Entity/ EntityReference? #117
Closed
@pmahend1

Description

@pmahend1

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: &num;</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: &#65;</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

Metadata

Metadata

Assignees

No one assigned

    Labels

    doctypeeverything related to doctype parsing and DTDneeds investigationInformation is missing and needs to be researchedspec:XMLhttps://www.w3.org/TR/xml11/strategicxml:validhttps://www.w3.org/TR/xml11/#dt-valid

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0