Receive notification of the beginning of an element.

The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding end_element event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding end_element event.

This event allows up to three name components for each element:

  1. the Namespace URI;
  2. the local name; and
  3. the qualified (prefixed) name.

Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:

  • the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
  • the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).

Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes property is true (it is false by default, and support for a true value is optional).

Parameters:

  • uri: Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
  • localName: local name (without prefix), or the empty string if Namespace processing is not being performed.
  • qname: The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.
  • atts: attributes attached to the element.

SEE: end_element SEE: Attributes

Property definitions

sax $ ContentHandler :: start_element
	# Receive notification of the beginning of an element.
	#
	# The Parser will invoke this method at the beginning of every
	# element in the XML document; there will be a corresponding
	# `end_element` event for every startElement event
	# (even when the element is empty). All of the element's content will be
	# reported, in order, before the corresponding `end_element`
	# event.
	#
	# This event allows up to three name components for each
	# element:
	#
	# 1. the Namespace URI;
	# 2. the local name; and
	# 3. the qualified (prefixed) name.
	#
	# Any or all of these may be provided, depending on the
	# values of the `http://xml.org/sax/features/namespaces`
	# and the `http://xml.org/sax/features/namespace-prefixes`
	# properties:
	#
	# * the Namespace URI and local name are required when
	# the namespaces property is `true` (the default), and are
	# optional when the namespaces property is `false` (if one is
	# specified, both must be);
	# * the qualified name is required when the namespace-prefixes property
	# is `true`, and is optional when the namespace-prefixes property
	# is `false` (the default).
	#
	# Note that the attribute list provided will contain only
	# attributes with explicit values (specified or defaulted):
	# `#IMPLIED` attributes will be omitted. The attribute list
	# will contain attributes used for Namespace declarations
	# (`xmlns*` attributes) only if the
	# `http://xml.org/sax/features/namespace-prefixes`
	# property is true (it is `false` by default, and support for a
	# `true` value is optional).
	#
	# Parameters:
	#
	# * `uri`: Namespace URI, or the empty string if the
	# element has no Namespace URI or if Namespace
	# processing is not being performed.
	# * `localName`: local name (without prefix), or the
	# empty string if Namespace processing is not being
	# performed.
	# * `qname`: The qualified XML 1.0 name (with prefix), or the
	# empty string if qualified names are not available.
	# * `atts`: attributes attached to the element.
	#
	# SEE: `end_element`
	# SEE: `sax::Attributes`
	fun start_element(uri: String, local_name: String, qname: String,
			atts: Attributes) do end
lib/sax/content_handler.nit:148,2--201,27

sax $ XMLFilterImpl :: start_element
	redef fun start_element(uri, local_name, qname, atts) do
		if content_handler != null then
			content_handler.start_element(uri, local_name, qname, atts)
		end
	end
lib/sax/helpers/xml_filter_impl.nit:288,2--292,4

saxophonit $ SAXEventLogger :: start_element
	redef fun start_element(uri, local_name, qname, atts) do
		var entry = new Array[String]
		var i = 0
		var length = atts.length

		entry.push("start_element")
		entry.push(uri)
		entry.push(local_name)
		entry.push(qname)
		while i < length do
			entry.push(atts.uri(i) or else "^NULL")
			entry.push(atts.local_name(i) or else "^NULL")
			entry.push(atts.qname(i) or else "^NULL")
			entry.push(atts.type_of(i) or else "^NULL")
			entry.push(atts.value_of(i) or else "^NULL")
			i += 1
		end
		log.push(entry)
		super
	end
lib/saxophonit/testing.nit:370,2--389,4