Receive an object for locating the origin of SAX document events.

SAX parsers are strongly encouraged (though not absolutely

required) to supply a locator: if it does so, it must supply

the locator to the application by invoking this method before invoking any of the other methods in the ContentHandler interface.

The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.

Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.

Parameter:

  • locator: object that can return the location of any SAX document event.

SEE: SAXLocator

Property definitions

sax $ ContentHandler :: document_locator=
	# Receive an object for locating the origin of SAX document events.
	#
	# SAX parsers are strongly encouraged (though not absolutely
	# required) to supply a locator: if it does so, it must supply
	# the locator to the application by invoking this method before
	# invoking any of the other methods in the ContentHandler
	# interface.
	#
	# The locator allows the application to determine the end
	# position of any document-related event, even if the parser is
	# not reporting an error. Typically, the application will
	# use this information for reporting its own errors (such as
	# character content that does not match an application's
	# business rules). The information returned by the locator
	# is probably not sufficient for use with a search engine.
	#
	# Note that the locator will return correct information only
	# during the invocation of the events in this interface. The
	# application should not attempt to use it at any other time.
	#
	# Parameter:
	#
	# * `locator`: object that can return the location of
	# any SAX document event.
	#
	# SEE: `sax::SAXLocator`
	fun document_locator=(locator: SAXLocator) do end
lib/sax/content_handler.nit:42,2--68,50

sax $ XMLFilterImpl :: document_locator=
	redef fun document_locator=(locator) do
		if content_handler != null then
			content_handler.document_locator = locator
		end
	end
lib/sax/helpers/xml_filter_impl.nit:258,2--262,4

saxophonit $ SAXEventLogger :: document_locator=
	redef fun document_locator=(locator) do
		log.push(["document_locator=",
				locator.public_id or else "^NULL",
				locator.system_id or else "^NULL",
				locator.line_number.to_s,
				locator.column_number.to_s])
		super
	end
lib/saxophonit/testing.nit:341,2--348,4