Retrieves an element from the document and returns it if it is non-null and has the expected type. Otherwise an error is thrown.
InvalidOperationError When the document element has an unexpected type.
UnexpectedNilError When the the document element is null.
null
The document from which to look up the element.
The ID of the element.
The type you expect the element to have.
The requested element, if it has the expected type.
Retrieves an element from the document and returns it if it is non-null and has the expected type. Otherwise an error is thrown.
Throws
InvalidOperationError When the document element has an unexpected type.
Throws
UnexpectedNilError When the the document element is
null
.