Look up the value of a feature flag.

The feature name is any fully-qualified URI. It is possible for an XMLReader to recognize a feature name but temporarily be unable to return its value. Some feature values may be available only in specific contexts, such as before, during, or after a parse. Also, some feature values may not be programmatically accessible.

All XMLReaders are required to recognize the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes feature names.

Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.

Parameter:

  • name: feature name, which is a fully-qualified URI.

Returns:

The current value of the feature.

SEE: feature_recognized

SEE: feature_readable

Property definitions

sax $ XMLReader :: feature
	# Look up the value of a feature flag.
	#
	# The feature name is any fully-qualified URI. It is
	# possible for an `XMLReader` to recognize a feature name but
	# temporarily be unable to return its value.
	# Some feature values may be available only in specific
	# contexts, such as before, during, or after a parse.
	# Also, some feature values may not be programmatically accessible.
	#
	# All XMLReaders are required to recognize the
	# `http://xml.org/sax/features/namespaces` and the
	# `http://xml.org/sax/features/namespace-prefixes` feature names.
	#
	# Implementors are free (and encouraged) to invent their own features,
	# using names built on their own URIs.
	#
	# Parameter:
	#
	# * `name`: feature name, which is a fully-qualified URI.
	#
	# Returns:
	#
	# The current value of the feature.
	#
	# SEE: `feature_recognized`
	#
	# SEE: `feature_readable`
	fun feature(name: String): Bool is abstract
lib/sax/xml_reader.nit:56,2--83,44

saxophonit $ XophonReader :: feature
	redef fun feature(name) do return model.feature(name)
lib/saxophonit/saxophonit.nit:104,2--54

sax $ XMLFilterImpl :: feature
	# Look up the value of a feature.
	#
	# This will always fail if the parent is `null`.
	#
	# Parameters:
	#
	# * `name`: The feature name.
	#
	# Returns:
	#
	# The current value of the feature.
	#
	# SEE: `feature_recognized`
	#
	# SEE: `feature_readable`
	redef fun feature(name) do
		assert sax_recognized: parent != null else
			sys.stderr.write("Feature: {name}\n")
		end
		return parent.feature(name)
	end
lib/sax/helpers/xml_filter_impl.nit:100,2--120,4