while ((ptr = XmlUtil.getNext(ptr)) != null) {
if (ptr instanceof Element) {
Element elt = (Element) ptr;
QDocumentType dtd;
dtd = (QDocumentType) elt.getOwnerDocument().getDoctype();
String id = null;
if (dtd != null)
id = (String) dtd.getElementId(elt.getNodeName());
if (id != null) {
String idValue = elt.getAttribute(id);
if (idList.contains(idValue) && ! list.contains(elt))
list.add(elt);