Skip to content

Incompabilities with the SII schema #64

@Gallaecio

Description

@Gallaecio

Signatures generated with signxml are currently not compatible with the XSD that the SII (Chile’s IRS) uses.

I am currently using a fork of signxml in order to sign SII documents, with the following changes:

Also, the SII expects the Signature element to be located as a sibling of the signed node, not within it. Hence, I am using a helper method for signing which receives the parent of the element to sign (which must be the only child):

def _sign(self, parent):
    children = list(parent)
    assert len(children) == 1
    element = children[0]
    element_with_signature = self._signer.sign(
        element, key=self._key, cert=self._certificate)
    signature = element_with_signature.find(
        '{http://www.w3.org/2000/09/xmldsig#}Signature')
    parent.append(signature)

I am hoping that, eventually, signxml will be usable for generating SII-compatible signatures without the need to fork it with these changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions