Altova RaptorXML Server 2024

Déboguer Scripts Phython côté Serveur

Accueil Préc Haut Suivant

La plupart des fonctionnalités de débogage—à l'exception des callbacks spécifiques au serveur—peuvent être utilisées dans un interpréteur Python standard ou dans un environnement (virtuel) après avoir installé le module RaptorXML Server en utilisant pip:

 

pip install –upgrade "/path/to/RaptorXML/application-folder/bin/raptorxml-version-cp37-cp37m-winversion.whl"

 

Après avoir installé la roue, vous devriez pouvoir utiliser toute IDE Python pour déboguer un script. Vous pourriez essayer d'extraire la fonctionnalité principale vers une fonction séparée qui prend un objet instance. Ceci peut ensuite être appelé (i) par les callbacks de RaptorXML Server, ou (ii) en exécutant directement le script avec un interpréteur Python.

 

 

from altova_api.v2 import xml, xsd, xbrl

 

def main(instance):

    # Here goes the application specific logic

 

# Main entry point, will be called by RaptorXML after the XML instance validation job has finished

def on_xsi_finished(job, instance):

    # instance object will be None if XML Schema validation was not successful

    if instance:

        main(instance)

 

# Main entry point, will be called by RaptorXML after the XBRL instance validation job has finished

def on_xbrl_finished(job, instance):

    # instance object will be None if XBRL 2.1 validation was not successful

    if instance:

        main(instance)

 

if __name__ == ‘__main__’:

    # parse arguments and create an instance

    instance = …

    main(instance)

© 2018-2024 Altova GmbH