Issue 16798: DTD not checked (original) (raw)

Created on 2012-12-28 01:37 by txomon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg178353 - (view) Author: Javier Domingo (txomon) Date: 2012-12-28 01:37
Hi, I am trying to find any tip on how to use minidom or etree xml implementations to check the xml syntax. I just found that the only way to check xml syntax throught dtds is using lxml. Would it be possible to implement this in the minidom or ElementTree default lib? I have seen bug http://bugs.python.org/issue2124 that speaks about the dtds fetch, but didn't see any place where it speaks about them being checked.
msg178453 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-12-29 01:13
You should ask for usage tips on python-list or other forums. 2.6 and 3.1 only get security fixes. 2.7 and 3.2,3.3 only get bug fixes. This looks like a request for a new feature (assuming that it is not available now). I am not familiar with the modules, but I expect that the request is out of scope for minidom. "xml.dom.minidom is a light-weight implementation of the Document Object Model interface. It is intended to be simpler than the full DOM and also significantly smaller." Eli, is etree open to new features and might the request be a sensible addition, or should this issue be closed?
msg178455 - (view) Author: Javier Domingo (txomon) Date: 2012-12-29 01:22
I am currently using a subprocess with a call to xmllint to make it create a temporal file that gets created on execution for xmllint use. I have seen about lxml, but I wondered if there is any place in the standard python to put xml validation
msg178465 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-12-29 02:52
Python's standard library does not currently provide a validating XML parser, and none is planned, so I propose to close this as "won't fix".
msg178468 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-12-29 03:24
I agree. The stdlib is not intended to do everything. That is why we maintain an index and optional repository for third party packages. For xml processing, lxml, in particular, is a recommended extension/replacement for advanced users. It includes an etree interface, to make migration from etree as easy as possible. Javier, if you disagree, you could post to the python-ideas list. But I strongly suspect you would get about the same answer, that there is no point to duplicating existing external packages, and no desire to incorporate any more external packages, at least not for xml.
msg178491 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2012-12-29 13:18
I have no plans adding this feature to etree.
History
Date User Action Args
2022-04-11 14:57:39 admin set github: 61002
2012-12-29 13🔞23 eli.bendersky set messages: +
2012-12-29 03:24:23 terry.reedy set status: open -> closedresolution: rejectedmessages: +
2012-12-29 02:52:34 loewis set nosy: + loewismessages: +
2012-12-29 01:22:06 txomon set messages: +
2012-12-29 01:13:43 terry.reedy set versions: + Python 3.4, - Python 2.6, Python 3.1, Python 2.7, Python 3.2, Python 3.3nosy: + terry.reedy, eli.benderskymessages: + type: behavior -> enhancement
2012-12-28 01:37:09 txomon create