protected CoreDocumentImpl createDocument(DocumentType doctype) { return new CoreDocumentImpl(doctype); }
/** * Deep-clone a document, including fixing ownerDoc for the cloned * children. Note that this requires bypassing the WRONG_DOCUMENT_ERR * protection. I've chosen to implement it by calling importNode * which is DOM Level 2. * * @return org.w3c.dom.Node * @param deep boolean, iff true replicate children */ public Node cloneNode(boolean deep) { CoreDocumentImpl newdoc = new CoreDocumentImpl(); callUserDataHandlers(this, newdoc, UserDataHandler.NODE_CLONED); cloneNode(newdoc, deep); return newdoc; } // cloneNode(boolean):Node
public MathML(String qualifiedName, String publicID, String systemID) { this(new CoreDocumentImpl()); CoreDocumentImpl document = (CoreDocumentImpl) document(); document.setXmlEncoding("utf-8"); document.appendChild(new DocumentTypeImpl(document, qualifiedName, publicID, systemID)); }
/** * Writes the Kalumet agent XML log file using in-memory DOM. */ public synchronized void writeXMLFile() { try { OutputFormat format = new OutputFormat(); format.setLineWidth( 72 ); format.setIndenting( true ); format.setIndent( 3 ); format.setEncoding( "ISO-8859-1" ); XMLSerializer serializer = new XMLSerializer( new FileOutputStream( this.basedir + "/" + MAIN_LOG_FILE ), format ); serializer.serialize( this.toDOMElement( new CoreDocumentImpl( true ) ) ); } catch ( Exception e ) { LOG.error( "Can't write update log file.", e ); } }
serializer.serialize( this.toDOMElement( new CoreDocumentImpl( true ) ) );
serializer.serialize( this.toDOMElement( new CoreDocumentImpl( true ) ) );