protected function emitDataRange( $pos, $length, $isSimple = false, $hasSimpleRefs = false ) {
		if ( $length === 0 ) {
			return;
		}
		if ( $this->ignoreCharRefs && $this->ignoreNulls && $this->ignoreErrors ) {
			// Pretend this data range doesn't contain < \0 or &
			$isSimple = true;
		}
		if ( $isSimple ) {
			$this->listener->characters( $this->text, $pos, $length, $pos, $length );
		} else {
			if ( !$this->ignoreErrors ) {
				// Any bare "<" in a data state text node is a parse error.
				// Uniquely to the data state, nulls are just flagged as errors
				// and passed through, they are not replaced.
				$this->handleAsciiErrors( "<\0", $this->text, $pos, $length, 0 );
			}

			$text = substr( $this->text, $pos, $length );
			if ( $hasSimpleRefs ) {
				$text = strtr( $text, self::$commonEntities );
			} else {
				$text = $this->handleCharRefs( $text, $pos );
			}
			$this->listener->characters( $text, 0, strlen( $text ), $pos, $length );
		}
	}