| Value: ``"http://xml.org/sax/features/namespaces"`` --- true: Perform Namespace |
| processing. --- false: Optionally do not perform Namespace processing (implies |
| namespace-prefixes; default). --- access: (parsing) read-only; (not parsing) |
| read/write |
| |
| |
| .. data:: feature_namespace_prefixes |
| |
n | Value: ``"http://xml.org/sax/features/namespace-prefixes"`` --- true: Report |
n | Value: ``"http://xml.org/sax/features/namespace-prefixes"`` --- true: Report |
| the original prefixed names and attributes used for Namespace declarations. --- |
| the original prefixed names and attributes used for Namespace |
| false: Do not report attributes used for Namespace declarations, and optionally |
| declarations. --- false: Do not report attributes used for Namespace |
| do not report original prefixed names (default). --- access: (parsing) read- |
| declarations, and optionally do not report original prefixed names |
| only; (not parsing) read/write |
| (default). --- access: (parsing) read-only; (not parsing) read/write |
| |
| |
| .. data:: feature_string_interning |
| |
| Value: ``"http://xml.org/sax/features/string-interning"`` --- true: All element |
| names, prefixes, attribute names, Namespace URIs, and local names are interned |
| using the built-in intern function. --- false: Names are not necessarily |
| interned, although they may be (default). --- access: (parsing) read-only; (not |
| parsing) read/write |
| |
| |
| .. data:: feature_validation |
| |
n | Value: ``"http://xml.org/sax/features/validation"`` --- true: Report all |
n | Value: ``"http://xml.org/sax/features/validation"`` --- true: Report all |
| validation errors (implies external-general-entities and external-parameter- |
| validation errors (implies external-general-entities and |
| entities). --- false: Do not report validation errors. --- access: (parsing) |
| external-parameter-entities). --- false: Do not report validation errors. --- |
| read-only; (not parsing) read/write |
| access: (parsing) read-only; (not parsing) read/write |
| |
| |
| .. data:: feature_external_ges |
| |
| Value: ``"http://xml.org/sax/features/external-general-entities"`` --- true: |
| Include all external general (text) entities. --- false: Do not include |
| external general entities. --- access: (parsing) read-only; (not parsing) |
| read/write |
| default). |
| |
| There are cases, however, when applications need to use prefixes in character |
| data or in attribute values, where they cannot safely be expanded automatically; |
| the :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events supply the |
| information to the application to expand prefixes in those contexts itself, if |
| necessary. |
| |
n | .. % % XXX This is not really the default, is it? MvL |
n | .. XXX This is not really the default, is it? MvL |
| |
| Note that :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events are not |
| guaranteed to be properly nested relative to each-other: all |
| :meth:`startPrefixMapping` events will occur before the corresponding |
| :meth:`startElement` event, and all :meth:`endPrefixMapping` events will occur |
| after the corresponding :meth:`endElement` event, but their order is not |
| guaranteed. |
| |
| |
| |
| .. method:: ContentHandler.startElement(name, attrs) |
| |
| Signals the start of an element in non-namespace mode. |
| |
| The *name* parameter contains the raw XML 1.0 name of the element type as a |
| string and the *attrs* parameter holds an object of the :class:`Attributes` |
n | interface (XXX reference: attributes-objects.html) containing the attributes of |
n | interface (see :ref:`attributes-objects`) containing the attributes of |
| the element. The object passed as *attrs* may be re-used by the parser; holding |
| on to a reference to it is not a reliable way to keep a copy of the attributes. |
| To keep a copy of the attributes, use the :meth:`copy` method of the *attrs* |
| object. |
| |
| |
| .. method:: ContentHandler.endElement(name) |
| |
| |
| .. method:: ContentHandler.startElementNS(name, qname, attrs) |
| |
| Signals the start of an element in namespace mode. |
| |
| The *name* parameter contains the name of the element type as a ``(uri, |
| localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used in |
| the source document, and the *attrs* parameter holds an instance of the |
t | :class:`AttributesNS` interface (XXX reference: attributes-ns-objects.html) |
t | :class:`AttributesNS` interface (see :ref:`attributes-ns-objects`) |
| containing the attributes of the element. If no namespace is associated with |
| the element, the *uri* component of *name* will be ``None``. The object passed |
| as *attrs* may be re-used by the parser; holding on to a reference to it is not |
| a reliable way to keep a copy of the attributes. To keep a copy of the |
| attributes, use the :meth:`copy` method of the *attrs* object. |
| |
| Parsers may set the *qname* parameter to ``None``, unless the |
| ``feature_namespace_prefixes`` feature is activated. |