/** * Creates an empty <code>DocumentType</code> node. Entity declarations * and notations are not made available. Entity reference expansions and * default attribute additions do not occur. It is expected that a future * version of the DOM will provide a way for populating a * <code>DocumentType</code>.<br> * HTML-only DOM implementations do not need to implement this method. * * @param qualifiedNameThe * qualified name of the document type to be created. * @param publicIdThe * external subset public identifier. * @param systemIdThe * external subset system identifier. * @return A new <code>DocumentType</code> node with * <code>Node.ownerDocument</code> set to <code>null</code>. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified qualified * name contains an illegal character. <br> * NAMESPACE_ERR: Raised if the <code>qualifiedName</code> * is malformed. * @see DOM Level 2 */ public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) throws DOMException { DocumentTypeImpl documentType = new DocumentTypeImpl(); documentType.setName(qualifiedName); documentType.setPublicId(publicId); documentType.setSystemId(systemId); return documentType; }
/** * getNodeName * * @return java.lang.String */ public String getNodeName() { return getName(); }
/** * cloneNode method * * @return org.w3c.dom.Node * @param deep * boolean */ public Node cloneNode(boolean deep) { DocumentTypeImpl cloned = new DocumentTypeImpl(this); notifyUserDataHandlers(UserDataHandler.NODE_CLONED, cloned); return cloned; }
/** * createDoctype method * * @return org.w3c.dom.DocumentType * @param name * java.lang.String */ public DocumentType createDoctype(String name) { DocumentTypeImpl docType = new DocumentTypeImpl(); docType.setOwnerDocument(this); docType.setName(name); return docType; }
/** * toString method * * @return java.lang.String */ public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(getName()); buffer.append('('); buffer.append(getPublicId()); buffer.append(')'); buffer.append('('); buffer.append(getSystemId()); buffer.append(')'); IStructuredDocumentRegion flatNode = getStructuredDocumentRegion(); if (flatNode != null) { buffer.append('@'); buffer.append(flatNode.toString()); } return buffer.toString(); } }
/** * setSystemId method * * @param systemId * java.lang.String */ public void setSystemId(String systemId) { if (!isDataEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.systemId = systemId; notifyValueChanged(); }
buffer.append(name); DocumentTypeImpl dt = (DocumentTypeImpl) docType; String publicID = dt.getPublicId(); String systemID = dt.getSystemId(); if (publicID != null) { buffer.append(' ');
/** */ public boolean isClosed() { IStructuredDocumentRegion flatNode = getStructuredDocumentRegion(); if (flatNode == null) return true; // will be generated String regionType = StructuredDocumentRegionUtil.getLastRegionType(flatNode); return (regionType == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE || regionType == DOMRegionContext.XML_DECLARATION_CLOSE); }
/** */ public void setInternalSubset(String internalSubset) { if (!isDataEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.internalSubset = internalSubset; }
/** * setPublicId method * * @param publicId * java.lang.String */ public void setPublicId(String publicId) { if (!isDataEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } this.publicId = publicId; notifyValueChanged(); }