Learn how to validate an XBRL document in Python : https://blog.aspose.com/finance/validate-xbrl-document-in-python/
The following topics are covered in this article:
Learn how to validate an XBRL document in Python : https://blog.aspose.com/finance/validate-xbrl-document-in-python/
The following topics are covered in this article:
| # This code example demonstrates how to validate Inline XBRL document. | |
| from aspose.finance.xbrl.inline import InlineXbrlDocument | |
| # The path to the input document | |
| inputFile = "C:\Files\sample.html" | |
| # Load XBRL file | |
| document = InlineXbrlDocument(inputFile) | |
| # Validate | |
| document.validate(); | |
| # Show validation errors if any | |
| if document.validation_errors.length > 0: | |
| for validationError in document.validation_errors: | |
| print(validationError.message) |
| # This code example demonstrates how to validate XBRL instance document. | |
| from aspose.finance.xbrl import XbrlDocument | |
| # The path to the input document | |
| inputFile = "C:\Files\sample.xbrl" | |
| # Load XBRL file | |
| document = XbrlDocument(inputFile) | |
| # Get instances | |
| xbrlInstances = document.xbrl_instances | |
| # Select specific instance | |
| xbrlInstance = xbrlInstances[0] | |
| # Validate | |
| xbrlInstance.validate() | |
| # Show validation errors if any | |
| if xbrlInstance.validation_errors.length > 0: | |
| for validationError in xbrlInstance.validation_errors: | |
| print(validationError.message) |