Set the value of a property.

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

XMLReaders are not required to recognize setting any specific property names, though a core set is defined by SAX2.

This method is also the standard mechanism for setting extended handlers.

Parameters:

  • name: property name, which is a fully-qualified URI.
  • value: requested value for the property.

SEE: property_recognized

SEE: property_writable

Property definitions

sax $ XMLReader :: property=
	# Set the value of a property.
	#
	# The property name is any fully-qualified URI. It is
	# possible for an `XMLReader` to recognize a property name but
	# to be unable to change the current value.
	# Some property values may be immutable or mutable only
	# in specific contexts, such as before, during, or after
	# a parse.
	#
	# XMLReaders are not required to recognize setting
	# any specific property names, though a core set is defined by
	# SAX2.
	#
	# This method is also the standard mechanism for setting
	# extended handlers.
	#
	# Parameters:
	#
	# * `name`: property name, which is a fully-qualified URI.
	# * `value`: requested value for the property.
	#
	# SEE: `property_recognized`
	#
	# SEE: `property_writable`
	fun property=(name: String, value: nullable Object) is abstract
lib/sax/xml_reader.nit:157,2--181,64

saxophonit $ XophonReader :: property=
	redef fun property=(name, value) do
		model.property(name) = value
	end
lib/saxophonit/saxophonit.nit:123,2--125,4

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

saxophonit $ SAXEventLogger :: property=
	redef fun property=(name, value) do
		assert sax_recognized: parent != null else
			sys.stderr.write("Property: {name}\n")
		end
		if decl_handler_uri == name then
			assert property_readable: property_writable(name) else
				sys.stderr.write("Property: {name}\n")
			end
			decl_handler = value.as(nullable DeclHandler)
		else if lexical_handler_uri == name then
			assert property_readable: property_writable(name) else
				sys.stderr.write("Property: {name}\n")
			end
			lexical_handler = value.as(nullable LexicalHandler)
		else
			parent.property(name) = value
		end
	end
lib/saxophonit/testing.nit:280,2--297,4