private function isNodeOffset($offset)
{
if (is_int($offset) || ctype_digit((string) $offset)) {
return TRUE;
} elseif ($this->isAttributeOffset($offset)) {
return FALSE;
}
throw new \InvalidArgumentException('Invalid offset. Use integer for child nodes and strings for attributes.');
}