Skip to content

Commit

Permalink
Add docs on how to override default namespace map
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Aug 20, 2022
1 parent 2ddaaf9 commit 7a5c538
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ For detached signatures, the code above will use the ``Id`` or ``ID`` attribute

See the `API documentation <https://xml-security.github.io/signxml/#id5>`_ for more.


Configuring namespace prefixes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some applications require a particular namespace prefix configuration - for example, a number of applications assume
that the ``http://www.w3.org/2000/09/xmldsig#"`` namespace is set as the default, unprefixed namespace instead of using
the customary ``ds:`` prefix. To configure the namespace prefix map when generating a signature, set the
``XMLSigner.namespaces`` attribute:

.. code-block:: python
signer = signxml.XMLSigner(...)
signer.namespaces = {None: signxml.namespaces.ds}
XML parsing security and compatibility with ``xml.etree.ElementTree``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SignXML uses the `lxml <https://github.com/lxml/lxml>`_ ElementTree library, not the
Expand Down

0 comments on commit 7a5c538

Please sign in to comment.