private String getPublicId(IDOMDocument doc) { if (doc == null) return null; DocumentType doctype = doc.getDoctype(); return (doctype != null) ? doctype.getPublicId() : doc.getDocumentTypeId(); } }
private void getInfo(ElementInfo info) { info.decl = CMUtil.getDeclaration(info.target); info.startTag = info.target.getStartStructuredDocumentRegion(); info.endTag = info.target.getEndStructuredDocumentRegion(); info.hasStartTag = (info.startTag != null); info.hasEndTag = (info.endTag != null); Document doc = info.target.getOwnerDocument(); if (!(doc instanceof IDOMDocument)) return; String typeid = ((IDOMDocument) doc).getDocumentTypeId(); if (typeid != null) { HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid); info.isXHTML = (entry != null && entry.isXMLType()); } }