public void selectNode(Node refNode)
throws RangeException
{
if (fDocument.errorChecking) {
if (fDetach) {
throw new DOMException(
DOMException.INVALID_STATE_ERR,
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
}
if ( !isLegalContainer( refNode.getParentNode() ) ||
!isLegalContainedNode( refNode ) ) {
throw new RangeExceptionImpl(
RangeException.INVALID_NODE_TYPE_ERR,
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
}
if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
throw new DOMException(
DOMException.WRONG_DOCUMENT_ERR,
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
}
}
Node parent = refNode.getParentNode();