Look up the index of an attribute by XML 1.0 qualified name.

Parameters:

  • qname: XML 1.0 qualified (prefixed) name.

Returns:

The index of the attribute, or -1 if it does not appear in the list.

Property definitions

sax $ Attributes :: index_of
	# Look up the index of an attribute by XML 1.0 qualified name.
	#
	# Parameters:
	#
	# * `qname`: XML 1.0 qualified (prefixed) name.
	#
	# Returns:
	#
	# The index of the attribute, or -1 if it does not
	# appear in the list.
	fun index_of(qname: String): Int is abstract
lib/sax/attributes.nit:161,2--171,45

sax $ AttributesImpl :: index_of
	# Look up the index of an attribute by XML 1.0 qualified name.
	#
	# In many cases, it will be more efficient to look up the name once and
	# query by `Int` index rather than quering by name repeatedly.
	#
	# Parameters:
	#
	# * `qname`: XML 1.0 qualified (prefixed) name.
	#
	# Returns:
	#
	# The index of the attribute, or -1 if it does not
	# appear in the list.
	redef fun index_of(qname) do
		var i = 0

		if "" != qname then
			while i < data.length do
				if data[i + 2] == qname then
					return i / 5
				end
				i += 5
			end
		end
		return -1
	end
lib/sax/helpers/attributes_impl.nit:174,2--199,4