EntityReference createEntityReference(String name) throws DOMException;
name
The name of the referenced entity.
A new EntityReference node that references an entity with the specified name.
This method may throw a DOMException with one of the following code values:
INVALID_CHARACTER_ERR
The specified entity name contains an illegal character.
NOT_SUPPORTED_ERR
This is an HTML document and does not support entity references.
This method creates and returns an EntityReference node that refers to an entity with the specified name. Note that it always throws an exception if this is an HTML document, because HTML does not allow entity references. If this document has a DocumentType node, and if that DocumentType defines an Entity object with the specified name, the returned EntityReference has the same children as the referenced Entity node.