@ Nonnull public static Document newDocument ( @ Nonnull final DocumentBuilder aDocBuilder , @ Nullable final EXMLVersion eVersion , @ Nonnull final String sQualifiedName , @ Nullable final String sPublicId , @ Nullable final String sSystemId ) { ValueEnforcer . notNull ( aDocBuilder , "DocBuilder" ) ; final DOMImplementation aDomImpl = aDocBuilder . getDOMImplementation ( ) ; final DocumentType aDocType = aDomImpl . createDocumentType ( sQualifiedName , sPublicId , sSystemId ) ; final Document aDoc = aDomImpl . createDocument ( sSystemId , sQualifiedName , aDocType ) ; aDoc . setXmlVersion ( ( eVersion != null ? eVersion : EXMLVersion . XML_10 ) . getVersion ( ) ) ; return aDoc ; }
Create a new document with a document type using a custom document builder .