Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAXReader-based XML should try to find and process the DTD #43

Open
logological opened this issue Jun 24, 2015 · 3 comments
Open

SAXReader-based XML should try to find and process the DTD #43

logological opened this issue Jun 24, 2015 · 3 comments

Comments

@logological
Copy link
Member

Originally reported on Google Code with ID 43

When SAXReader-based XML readers try to read an XML file which specifies a DTD, they
fail because they can't find the DTD.

The problem can possibly be solved in *some* cases by using an EntityResolver which
looks for the DTD in the same place as the XML file.  However, I am pretty sure this
won't always work if the XML file is being read from the classpath, since it might
be inside a JAR.

Readers should probably therefore include a configuration parameter for ignoring the
DTD.  This would be implemented by an EntityResolver returning an empty InputSource.

Reported by [email protected] on 2013-11-06 13:59:36

@logological
Copy link
Member Author

Reported by [email protected] on 2013-11-06 14:00:03

@logological
Copy link
Member Author

I implemented a null EntityResolver and made all the XML readers use it.  This isn't
an ideal solution as the XML readers will no longer issue a diagnostic for bad XML
files.

The XML reader in de.tudarmstadt.ukp.dkpro.core.io.xml seems to use some other SAX-based
method of handling XML which might not have this DTD problem.  We should study it and
see if we can adapt the technique.

Reported by [email protected] on 2013-11-06 14:51:01

  • Labels added: Priority-Medium
  • Labels removed: Priority-High

@logological
Copy link
Member Author

Reported by [email protected] on 2013-11-06 14:53:56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant