lemminx icon indicating copy to clipboard operation
lemminx copied to clipboard

Parser gets confused by DTDs

Open laeubi opened this issue 3 years ago • 6 comments

  1. Download https://github.com/AnIML/techniques/raw/master/ecd-trace.atdd
  2. rename it to .xml
  3. Download https://github.com/AnIML/techniques/raw/master/animl_unit_entities.dtd
  4. open the renamed xml inside eclipse
  5. You get a lot of Element type "..." must be declared.
  6. Now remove the line <!DOCTYPE Technique SYSTEM "animl_unit_entities.dtd">
  7. Now the errors are gone (but you will see ones complain about missing entities defined in the DTD of course)

laeubi avatar Mar 02 '22 11:03 laeubi

With intellij I have the same problem. I wonder if it's a valid DTD or if we need to set a xerces option to support it.

angelozerr avatar Mar 02 '22 12:03 angelozerr

I can only tell that when parsing the file with JAXB there is no complaint even when validation against the XSD.

The only issue I faced was that java by default do not allow to load DTDs from any source so for development purpose I enabled the following setting -Djavax.xml.accessExternalDTD=all

laeubi avatar Mar 02 '22 12:03 laeubi

I have the impression that it's the same issue https://www.oxygenxml.com/forum/post36904.html#p36904

angelozerr avatar Mar 02 '22 13:03 angelozerr

I can parse and validate the files with JAXB no idea if it uses xerces under the hood at all :-)

laeubi avatar Mar 02 '22 13:03 laeubi