Set the value of a feature flag.

The feature name is any fully-qualified URI. It is possible for an XMLReader to expose a feature value but to be unable to change the current value. Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.

All XMLReaders are required to support setting http://xml.org/sax/features/namespaces to true and http://xml.org/sax/features/namespace-prefixes to false.

Parameters:

  • name: feature name, which is a fully-qualified URI.
  • value: requested value of the feature.

SEE: feature_recognized

SEE: feature_writable

Property definitions

sax $ XMLReader :: feature=
	# Set the value of a feature flag.
	#
	# The feature name is any fully-qualified URI. It is
	# possible for an XMLReader to expose a feature value but
	# to be unable to change the current value.
	# Some feature values may be immutable or mutable only
	# in specific contexts, such as before, during, or after
	# a parse.
	#
	# All XMLReaders are required to support setting
	# http://xml.org/sax/features/namespaces to true and
	# http://xml.org/sax/features/namespace-prefixes to false.
	#
	# Parameters:
	#
	# * `name`: feature name, which is a fully-qualified URI.
	# * `value`: requested value of the feature.
	#
	# SEE: `feature_recognized`
	#
	# SEE: `feature_writable`
	fun feature=(name: String, value: Bool) is abstract
lib/sax/xml_reader.nit:85,2--106,52

saxophonit $ XophonReader :: feature=
	redef fun feature=(name, value) do model.feature(name) = value
lib/saxophonit/saxophonit.nit:105,2--63

sax $ XMLFilterImpl :: feature=
	# Set the value of a feature.
	#
	# This will always fail if the parent is `null`.
	#
	# Parameters:
	#
	# * `name`: feature name.
	# * `value`: requested feature value.
	#
	# Returns:
	#
	# `true` if the feature is set; `false` if the feature can not be set given
	# the current context.
	#
	# SEE: `feature_recognized`
	#
	# SEE: `feature_writable`
	redef fun feature=(name, value) do
		assert sax_recognized: parent != null else
			sys.stderr.write("Feature: {name}\n")
		end
		parent.feature(name) = value
	end
lib/sax/helpers/xml_filter_impl.nit:122,2--144,4