ECMAScript binding: createDocumentType(qualifiedName, publicId, systemId) (returns DocumentType; all parameters are strings; can raise DOMException)
Creates a DocumentType object for a particular DTD. qualifiedName, publicId and systemId refer to the parameters to the !DOCTYPE directive. For example,
<!DOCTYPE
book
PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"/usr/lib/DTDs/docbkx412/DOCBOOKX.DTD">
could be expressed as
var DOMImplementation = document.implementation;
var bookType = DOMImplementation.createDocumentType("book", "-//OASIS//DTD DocBook XML V4.1.2//EN", "/usr/lib/DTDs/docbkx412/DOCBOOKX.DTD");
Note that, here, book is a local name within the default namespace.
Also note there's no way of creating <!ENTITY> references (that is, you can't script something like this:
<!DOCTYPE
book
PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"/usr/lib/DTDs/docbkx412/DOCBOOKX.DTD"[
<!ENTITY chp1 "chp1.xml">
]>
). This may be available in a subsequent version.
The exceptions thrown are:
- INVALID_CHARACTER_ERR
- qualifiedName contains an illegal character.
- NAMESPACE_ERR
- qualfiedName is otherwise malformed.